BulletSim: add physical parameter min/max constants in BSParam. I just don't like raw numbers scattered around the code.
parent
e98e223927
commit
f3baed5827
|
@ -89,6 +89,18 @@ public static class BSParam
|
||||||
public static float PID_D { get; private set; } // derivative
|
public static float PID_D { get; private set; } // derivative
|
||||||
public static float PID_P { get; private set; } // proportional
|
public static float PID_P { get; private set; } // proportional
|
||||||
|
|
||||||
|
// Various constants that come from that other virtual world that shall not be named
|
||||||
|
public const float MinGravityZ = -1f;
|
||||||
|
public const float MaxGravityZ = 28f;
|
||||||
|
public const float MinFriction = 0f;
|
||||||
|
public const float MaxFriction = 255f;
|
||||||
|
public const float MinDensity = 0f;
|
||||||
|
public const float MaxDensity = 22587f;
|
||||||
|
public const float MinRestitution = 0f;
|
||||||
|
public const float MaxRestitution = 1f;
|
||||||
|
public const float MaxAddForceMagnitude = 20000f;
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
public delegate void ParamUser(BSScene scene, IConfig conf, string paramName, float val);
|
public delegate void ParamUser(BSScene scene, IConfig conf, string paramName, float val);
|
||||||
public delegate float ParamGet(BSScene scene);
|
public delegate float ParamGet(BSScene scene);
|
||||||
public delegate void ParamSet(BSScene scene, string paramName, uint localID, float val);
|
public delegate void ParamSet(BSScene scene, string paramName, uint localID, float val);
|
||||||
|
|
|
@ -1025,10 +1025,10 @@ public sealed class BSPrim : BSPhysObject
|
||||||
if (force.IsFinite())
|
if (force.IsFinite())
|
||||||
{
|
{
|
||||||
float magnitude = force.Length();
|
float magnitude = force.Length();
|
||||||
if (magnitude > 20000f)
|
if (magnitude > BSParam.MaxAddForceMagnitude)
|
||||||
{
|
{
|
||||||
// Force has a limit
|
// Force has a limit
|
||||||
force = force / magnitude * 20000f;
|
force = force / magnitude * BSParam.MaxAddForceMagnitude;
|
||||||
}
|
}
|
||||||
|
|
||||||
OMV.Vector3 addForce = force;
|
OMV.Vector3 addForce = force;
|
||||||
|
|
|
@ -38,15 +38,6 @@ using Nini.Config;
|
||||||
using log4net;
|
using log4net;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
|
|
||||||
// TODOs for BulletSim (for BSScene, BSPrim, BSCharacter and BulletSim)
|
|
||||||
// Based on material, set density and friction
|
|
||||||
// More efficient memory usage when passing hull information from BSPrim to BulletSim
|
|
||||||
// Do attachments need to be handled separately? Need collision events. Do not collide with VolumeDetect
|
|
||||||
// Implement LockAngularMotion
|
|
||||||
// Add PID movement operations. What does ScenePresence.MoveToTarget do?
|
|
||||||
// Check terrain size. 128 or 127?
|
|
||||||
// Raycast
|
|
||||||
//
|
|
||||||
namespace OpenSim.Region.Physics.BulletSPlugin
|
namespace OpenSim.Region.Physics.BulletSPlugin
|
||||||
{
|
{
|
||||||
public sealed class BSScene : PhysicsScene, IPhysicsParameters
|
public sealed class BSScene : PhysicsScene, IPhysicsParameters
|
||||||
|
|
|
@ -96,6 +96,7 @@ Selecting and deselecting physical objects causes CPU processing time to jump
|
||||||
put thousand physical objects, select and deselect same. CPU time will be large.
|
put thousand physical objects, select and deselect same. CPU time will be large.
|
||||||
Re-implement buoyancy as a separate force on the object rather than diddling gravity.
|
Re-implement buoyancy as a separate force on the object rather than diddling gravity.
|
||||||
Register a pre-step event to add the force.
|
Register a pre-step event to add the force.
|
||||||
|
More efficient memory usage when passing hull information from BSPrim to BulletSim
|
||||||
|
|
||||||
LINKSETS
|
LINKSETS
|
||||||
======================================================
|
======================================================
|
||||||
|
|
Loading…
Reference in New Issue