BulletSim: change physical data structures to classes. Add default

instantiations for PhysBody and PhysShape when BSPhysObject is created
to account for them being classes and not structures.
Update TODO list.
0.7.5-pf-bulletsim
Robert Adams 2012-12-29 18:34:46 -08:00
parent 4914d6c0ea
commit 203588e3c0
5 changed files with 29 additions and 15 deletions

View File

@ -48,12 +48,15 @@ public sealed class BSLinksetConstraints : BSLinkset
{
base.Refresh(requestor);
// Queue to happen after all the other taint processing
PhysicsScene.PostTaintObject("BSLinksetContraints.Refresh", requestor.LocalID, delegate()
{
if (HasAnyChildren && IsRoot(requestor))
RecomputeLinksetConstraints();
});
if (HasAnyChildren && IsRoot(requestor))
{
// Queue to happen after all the other taint processing
PhysicsScene.PostTaintObject("BSLinksetContraints.Refresh", requestor.LocalID, delegate()
{
if (HasAnyChildren && IsRoot(requestor))
RecomputeLinksetConstraints();
});
}
}
// The object is going dynamic (physical). Do any setup necessary

View File

@ -67,6 +67,11 @@ public abstract class BSPhysObject : PhysicsActor
PhysObjectName = name;
TypeName = typeName;
// We don't have any physical representation yet.
PhysBody = new BulletBody(localID);
PhysShape = new BulletShape();
// A linkset of just me
Linkset = BSLinkset.Factory(PhysicsScene, this);
LastAssetBuildFailed = false;

View File

@ -111,10 +111,7 @@ public sealed class BSPrim : BSPhysObject
_mass = CalculateMass();
// No body or shape yet
PhysBody = new BulletBody(LocalID);
PhysShape = new BulletShape();
// Cause linkset variables to be initialized (like mass)
Linkset.Refresh(this);
DetailLog("{0},BSPrim.constructor,call", LocalID);

View File

@ -35,7 +35,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin
// These hold pointers to allocated objects in the unmanaged space.
// The physics engine controller class created at initialization
public struct BulletWorld
public class BulletWorld
{
public BulletWorld(uint worldId, BSScene bss, IntPtr xx)
{
@ -50,7 +50,7 @@ public struct BulletWorld
}
// An allocated Bullet btRigidBody
public struct BulletBody
public class BulletBody
{
public BulletBody(uint id) : this(id, IntPtr.Zero)
{
@ -96,9 +96,14 @@ public struct BulletBody
}
}
public struct BulletShape
public class BulletShape
{
public BulletShape(IntPtr xx) : this(xx, BSPhysicsShapeType.SHAPE_UNKNOWN)
public BulletShape()
: this(IntPtr.Zero, BSPhysicsShapeType.SHAPE_UNKNOWN)
{
}
public BulletShape(IntPtr xx)
: this(xx, BSPhysicsShapeType.SHAPE_UNKNOWN)
{
}
public BulletShape(IntPtr xx, BSPhysicsShapeType typ)
@ -136,7 +141,7 @@ public struct BulletShape
}
// An allocated Bullet btConstraint
public struct BulletConstraint
public class BulletConstraint
{
public BulletConstraint(IntPtr xx)
{

View File

@ -97,6 +97,9 @@ Selecting and deselecting physical objects causes CPU processing time to jump
Re-implement buoyancy as a separate force on the object rather than diddling gravity.
Register a pre-step event to add the force.
More efficient memory usage when passing hull information from BSPrim to BulletSim
Avatar movement motor check for zero or small movement. Somehow suppress small movements
when avatar has stopped and is just standing. Simple test for near zero has
the problem of preventing starting up (increase from zero) especially when falling.
LINKSETS
======================================================
@ -195,6 +198,7 @@ Should taints check for existance or activeness of target?
keeps the object from being freed, but that is just an accident.
Possibly have and 'active' flag that is checked by the taint processor?
Parameters for physics logging should be moved from BSScene to BSParam (at least boolean ones)
Can some of the physical wrapper classes (BulletBody, BulletWorld, BulletShape) be 'sealed'?
THREADING
=================================================