From b83449ae9ad3073abaa06167a99c47943c3199c2 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Fri, 26 Oct 2012 13:47:28 -0700 Subject: BulletSim: correct spelling of Bullet call. It's 'swept' not 'sweep'. --- OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs index 5ffd591..be3a5ad 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs @@ -881,10 +881,10 @@ public static extern float GetCcdMotionThreshold2(IntPtr obj); public static extern void SetCcdMotionThreshold2(IntPtr obj, float val); [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern float GetCcdSweepSphereRadius2(IntPtr obj); +public static extern float GetCcdSweptSphereRadius2(IntPtr obj); [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern void SetCcdSweepSphereRadius2(IntPtr obj, float val); +public static extern void SetCcdSweptSphereRadius2(IntPtr obj, float val); [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] public static extern IntPtr GetUserPointer2(IntPtr obj); -- cgit v1.1 From 4cfa3be4efbca49e4670b92ec2c110f65f658b8e Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Mon, 29 Oct 2012 14:28:24 -0700 Subject: BulletSim: add definitions for linkset collision mask --- OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs index be3a5ad..9b7ba03 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs @@ -378,6 +378,7 @@ public enum CollisionFilterGroups : uint BTerrainFilter = 1 << 11, BRaycastFilter = 1 << 12, BSolidFilter = 1 << 13, + BLinksetFilter = 1 << 14, // The collsion filters and masked are defined in one place -- don't want them scattered AvatarFilter = BCharacterFilter, @@ -386,6 +387,8 @@ public enum CollisionFilterGroups : uint ObjectMask = BAllFilter, StaticObjectFilter = BStaticFilter, StaticObjectMask = BAllFilter, + LinksetFilter = BLinksetFilter, + LinksetMask = BAllFilter & ~BLinksetFilter, VolumeDetectFilter = BSensorTrigger, VolumeDetectMask = ~BSensorTrigger, TerrainFilter = BTerrainFilter, -- cgit v1.1 From 39c02dcc8c537d5989238ec97c876e033895a8a9 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Thu, 1 Nov 2012 10:23:37 -0700 Subject: BulletSim: Remove use of shapeData in ShapeCollection and rely on the available BSPhysObject varaiables. Fix line endings in BSLinksetCompound. --- OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs index 9b7ba03..3b6355c 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs @@ -194,6 +194,7 @@ public struct ShapeData // following defined by BulletSim SHAPE_GROUNDPLANE = 20, SHAPE_TERRAIN = 21, + SHAPE_COMPOUND = 22, }; public uint ID; public PhysicsShapeType Type; -- cgit v1.1 From b0eccd5044b1a20b995a62d6fb76fdd73b712f9a Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Fri, 2 Nov 2012 09:53:41 -0700 Subject: BulletSim: debugging of compound shape implementation of linksets. Add compound shape creation and freeing in shape manager. Add optional taint-time execution method and update code to use it. Add API2 linkage for more compound shape methods (get num, get/remove by index, ...) Modify perferred shape return so linkset children can have differet shapes than root. Add Position and Orientation calls to linksets so children can be moved around by the linkset by its own calculation. Allows for very general linkset implementations. --- OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs index 3b6355c..143b8be 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs @@ -399,8 +399,6 @@ public enum CollisionFilterGroups : uint }; - - // CFM controls the 'hardness' of the constraint. 0=fixed, 0..1=violatable. Default=0 // ERP controls amount of correction per tick. Usable range=0.1..0.8. Default=0.2. public enum ConstraintParams : int @@ -618,10 +616,19 @@ public static extern IntPtr BuildCapsuleShape2(IntPtr world, float radius, float public static extern IntPtr CreateCompoundShape2(IntPtr sim); [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern void AddChildToCompoundShape2(IntPtr cShape, IntPtr addShape, Vector3 pos, Quaternion rot); +public static extern int GetNumberOfCompoundChildren2(IntPtr cShape); + +[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] +public static extern void AddChildShapeToCompoundShape2(IntPtr cShape, IntPtr addShape, Vector3 pos, Quaternion rot); + +[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] +public static extern IntPtr GetChildShapeFromCompoundShapeIndex2(IntPtr cShape, int indx); + +[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] +public static extern IntPtr RemoveChildShapeFromCompoundShapeIndex2(IntPtr cShape, int indx); [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern void RemoveChildFromCompoundShape2(IntPtr cShape, IntPtr removeShape); +public static extern void RemoveChildShapeFromCompoundShape2(IntPtr cShape, IntPtr removeShape); [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] public static extern IntPtr DuplicateCollisionShape2(IntPtr sim, IntPtr srcShape, uint id); -- cgit v1.1 From 1dc23b2b9713f4099534ae0d08c2caf5c8b036b4 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Fri, 2 Nov 2012 10:35:12 -0700 Subject: BulletSim: parameterize selection of linkset implementation --- OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs index 143b8be..ac6d2b2 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs @@ -300,6 +300,7 @@ public struct ConfigurationParameters public float shouldEnableFrictionCaching; public float numberOfSolverIterations; + public float linksetImplementation; public float linkConstraintUseFrameOffset; public float linkConstraintEnableTransMotor; public float linkConstraintTransMotorMaxVel; -- cgit v1.1 From 79f7c466a116bf368423d4e18163f34fd8d66ce1 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Sat, 3 Nov 2012 21:08:39 -0700 Subject: BulletSim: fix compound linkset crash by not freeing shape of child prims. Remove all compilation warnings (mostly 'protected' in sealed classes.) Add the dynamicAabbEnable parameter to creation of compound shapes. --- OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs index ac6d2b2..702bd77 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs @@ -614,7 +614,7 @@ public static extern bool IsNativeShape2(IntPtr shape); public static extern IntPtr BuildCapsuleShape2(IntPtr world, float radius, float height, Vector3 scale); [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern IntPtr CreateCompoundShape2(IntPtr sim); +public static extern IntPtr CreateCompoundShape2(IntPtr sim, bool enableDynamicAabbTree); [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] public static extern int GetNumberOfCompoundChildren2(IntPtr cShape); -- cgit v1.1 From 36d77fe27c4a49127c5d5baa4ed4653a25f1726d Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Tue, 6 Nov 2012 12:04:55 -0800 Subject: BulletSim: Add separate linear and angular damping function calls. Add function for recalculating compound shape bounding box. --- OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs index 702bd77..07149d8 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs @@ -632,6 +632,9 @@ public static extern IntPtr RemoveChildShapeFromCompoundShapeIndex2(IntPtr cShap public static extern void RemoveChildShapeFromCompoundShape2(IntPtr cShape, IntPtr removeShape); [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] +public static extern void RecalculateCompoundShapeLocalAabb2(IntPtr cShape); + +[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] public static extern IntPtr DuplicateCollisionShape2(IntPtr sim, IntPtr srcShape, uint id); [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] @@ -919,6 +922,12 @@ public static extern Vector3 GetGravity2(IntPtr obj); public static extern void SetDamping2(IntPtr obj, float lin_damping, float ang_damping); [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] +public static extern void SetLinearDamping2(IntPtr obj, float lin_damping); + +[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] +public static extern void SetAngularDamping2(IntPtr obj, float ang_damping); + +[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] public static extern float GetLinearDamping2(IntPtr obj); [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -- cgit v1.1 From 079a1e704fcaa9fddc9bb3de0a205969cba058bc Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Sun, 18 Nov 2012 18:17:30 -0800 Subject: BulletSim: remove the obsolete interface to the Bullet code. Update BulletSim libraries with code stripped of the obsolete code. --- .../Region/Physics/BulletSPlugin/BulletSimAPI.cs | 134 --------------------- 1 file changed, 134 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs index 07149d8..28fae13 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs @@ -429,140 +429,6 @@ static class BulletSimAPI { [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void DebugLogCallback([MarshalAs(UnmanagedType.LPStr)]string msg); -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -[return: MarshalAs(UnmanagedType.LPStr)] -public static extern string GetVersion(); - -/* Remove the linkage to the old api methods -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern uint Initialize(Vector3 maxPosition, IntPtr parms, - int maxCollisions, IntPtr collisionArray, - int maxUpdates, IntPtr updateArray, - DebugLogCallback logRoutine); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern void CreateInitialGroundPlaneAndTerrain(uint worldID); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern void SetHeightmap(uint worldID, [MarshalAs(UnmanagedType.LPArray)] float[] heightMap); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern void Shutdown(uint worldID); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern bool UpdateParameter(uint worldID, uint localID, - [MarshalAs(UnmanagedType.LPStr)]string paramCode, float value); - -// =============================================================================== -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern int PhysicsStep(uint worldID, float timeStep, int maxSubSteps, float fixedTimeStep, - out int updatedEntityCount, - out IntPtr updatedEntitiesPtr, - out int collidersCount, - out IntPtr collidersPtr); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern bool CreateHull(uint worldID, System.UInt64 meshKey, - int hullCount, [MarshalAs(UnmanagedType.LPArray)] float[] hulls - ); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern bool CreateMesh(uint worldID, System.UInt64 meshKey, - int indexCount, [MarshalAs(UnmanagedType.LPArray)] int[] indices, - int verticesCount, [MarshalAs(UnmanagedType.LPArray)] float[] vertices - ); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern bool DestroyHull(uint worldID, System.UInt64 meshKey); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern bool DestroyMesh(uint worldID, System.UInt64 meshKey); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern bool CreateObject(uint worldID, ShapeData shapeData); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern Vector3 GetObjectPosition(uint WorldID, uint id); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern Quaternion GetObjectOrientation(uint WorldID, uint id); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern bool SetObjectTranslation(uint worldID, uint id, Vector3 position, Quaternion rotation); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern bool SetObjectVelocity(uint worldID, uint id, Vector3 velocity); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern bool SetObjectAngularVelocity(uint worldID, uint id, Vector3 angularVelocity); - -// Set the current force acting on the object -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern bool SetObjectForce(uint worldID, uint id, Vector3 force); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern bool SetObjectScaleMass(uint worldID, uint id, Vector3 scale, float mass, bool isDynamic); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern bool SetObjectCollidable(uint worldID, uint id, bool phantom); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern bool SetObjectDynamic(uint worldID, uint id, bool isDynamic, float mass); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern bool SetObjectGhost(uint worldID, uint id, bool ghostly); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern bool SetObjectProperties(uint worldID, uint id, bool isStatic, bool isSolid, bool genCollisions, float mass); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern bool SetObjectBuoyancy(uint worldID, uint id, float buoyancy); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern bool HasObject(uint worldID, uint id); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern bool DestroyObject(uint worldID, uint id); - -// =============================================================================== -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern SweepHit ConvexSweepTest(uint worldID, uint id, Vector3 to, float extraMargin); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern RaycastHit RayTest(uint worldID, uint id, Vector3 from, Vector3 to); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern Vector3 RecoverFromPenetration(uint worldID, uint id); - -// =============================================================================== -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern void DumpBulletStatistics(); -*/ -// Log a debug message -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern void SetDebugLogCallback(DebugLogCallback callback); - -// =============================================================================== -// =============================================================================== -// =============================================================================== -// A new version of the API that enables moving all the logic out of the C++ code and into -// the C# code. This will make modifications easier for the next person. -// This interface passes the actual pointers to the objects in the unmanaged -// address space. All the management (calls for creation/destruction/lookup) -// is done in the C# code. -// The names have a "2" tacked on. This will be removed as the C# code gets rebuilt -// and the old code is removed. - -// Functions use while converting from API1 to API2. Can be removed when totally converted. -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern IntPtr GetSimHandle2(uint worldID); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern IntPtr GetBodyHandleWorldID2(uint worldID, uint id); - -[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -public static extern IntPtr GetBodyHandle2(IntPtr world, uint id); - // =============================================================================== // Initialization and simulation [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] -- cgit v1.1 From d6db0d5740dae03174f65846556f2f06d573b5c4 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Tue, 20 Nov 2012 11:24:25 -0800 Subject: BulletSim: uplevel PhysicsShapeType out of ShapeData structure (since it is getting simplified out of existance someday) and update all the references to that enum. --- .../Region/Physics/BulletSPlugin/BulletSimAPI.cs | 37 +++++++++++----------- 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs index 28fae13..bb63b0a 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs @@ -88,11 +88,11 @@ public struct BulletShape public BulletShape(IntPtr xx) { ptr = xx; - type=ShapeData.PhysicsShapeType.SHAPE_UNKNOWN; + type=PhysicsShapeType.SHAPE_UNKNOWN; shapeKey = 0; isNativeShape = false; } - public BulletShape(IntPtr xx, ShapeData.PhysicsShapeType typ) + public BulletShape(IntPtr xx, PhysicsShapeType typ) { ptr = xx; type = typ; @@ -100,7 +100,7 @@ public struct BulletShape isNativeShape = false; } public IntPtr ptr; - public ShapeData.PhysicsShapeType type; + public PhysicsShapeType type; public System.UInt64 shapeKey; public bool isNativeShape; public override string ToString() @@ -178,24 +178,25 @@ public struct ConvexHull int VertexCount; Vector3[] Vertices; } +public enum PhysicsShapeType +{ + SHAPE_UNKNOWN = 0, + SHAPE_AVATAR = 1, + SHAPE_BOX = 2, + SHAPE_CONE = 3, + SHAPE_CYLINDER = 4, + SHAPE_SPHERE = 5, + SHAPE_MESH = 6, + SHAPE_HULL = 7, + // following defined by BulletSim + SHAPE_GROUNDPLANE = 20, + SHAPE_TERRAIN = 21, + SHAPE_COMPOUND = 22, + SHAPE_HEIGHTMAP = 23, +}; [StructLayout(LayoutKind.Sequential)] public struct ShapeData { - public enum PhysicsShapeType - { - SHAPE_UNKNOWN = 0, - SHAPE_AVATAR = 1, - SHAPE_BOX = 2, - SHAPE_CONE = 3, - SHAPE_CYLINDER = 4, - SHAPE_SPHERE = 5, - SHAPE_MESH = 6, - SHAPE_HULL = 7, - // following defined by BulletSim - SHAPE_GROUNDPLANE = 20, - SHAPE_TERRAIN = 21, - SHAPE_COMPOUND = 22, - }; public uint ID; public PhysicsShapeType Type; public Vector3 Position; -- cgit v1.1 From 65e55ada87e110b65f3d69eb0a4f2402fb1f3ece Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Tue, 20 Nov 2012 11:30:22 -0800 Subject: BulletSim: uplevel FixedShapeKey out of ShapeData structure (since it is getting simplified out of existance someday) and update all the references to same. --- .../Region/Physics/BulletSPlugin/BulletSimAPI.cs | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs index bb63b0a..75e7f99 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs @@ -89,7 +89,7 @@ public struct BulletShape { ptr = xx; type=PhysicsShapeType.SHAPE_UNKNOWN; - shapeKey = 0; + shapeKey = (System.UInt64)FixedShapeKey.KEY_NONE; isNativeShape = false; } public BulletShape(IntPtr xx, PhysicsShapeType typ) @@ -194,6 +194,18 @@ public enum PhysicsShapeType SHAPE_COMPOUND = 22, SHAPE_HEIGHTMAP = 23, }; + +// The native shapes have predefined shape hash keys +public enum FixedShapeKey : ulong +{ + KEY_NONE = 0, + KEY_BOX = 1, + KEY_SPHERE = 2, + KEY_CONE = 3, + KEY_CYLINDER = 4, + KEY_CAPSULE = 5, +} + [StructLayout(LayoutKind.Sequential)] public struct ShapeData { @@ -217,16 +229,6 @@ public struct ShapeData // note that bools are passed as floats since bool size changes by language and architecture public const float numericTrue = 1f; public const float numericFalse = 0f; - - // The native shapes have predefined shape hash keys - public enum FixedShapeKey : ulong - { - KEY_BOX = 1, - KEY_SPHERE = 2, - KEY_CONE = 3, - KEY_CYLINDER = 4, - KEY_CAPSULE = 5, - } } [StructLayout(LayoutKind.Sequential)] public struct SweepHit -- cgit v1.1 From 8dd5813889b17cc213d20491b41dbf8142b3ccb9 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Tue, 20 Nov 2012 11:33:42 -0800 Subject: BulletSim: rename SHAPE_AVATAR to SHAPE_CAPSULE with the eye to eventually having mesh avatars. --- OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs index 75e7f99..407d6d7 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs @@ -181,7 +181,7 @@ public struct ConvexHull public enum PhysicsShapeType { SHAPE_UNKNOWN = 0, - SHAPE_AVATAR = 1, + SHAPE_CAPSULE = 1, SHAPE_BOX = 2, SHAPE_CONE = 3, SHAPE_CYLINDER = 4, -- cgit v1.1 From 71b9640dfa67e830769aad64ef208d767e102c92 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Tue, 20 Nov 2012 14:51:50 -0800 Subject: BulletSim: pull heightmap implementation out of the terrain manager so a mesh terrain can be implemented. --- OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs index 407d6d7..bab3b3d 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs @@ -152,7 +152,7 @@ public class BulletHeightMapInfo ID = id; Ptr = xx; heightMap = hm; - terrainRegionBase = new Vector2(0f, 0f); + terrainRegionBase = Vector3.Zero; minCoords = new Vector3(100f, 100f, 25f); maxCoords = new Vector3(101f, 101f, 26f); minZ = maxZ = 0f; @@ -161,7 +161,7 @@ public class BulletHeightMapInfo public uint ID; public IntPtr Ptr; public float[] heightMap; - public Vector2 terrainRegionBase; + public Vector3 terrainRegionBase; public Vector3 minCoords; public Vector3 maxCoords; public float sizeX, sizeY; -- cgit v1.1 From 34cbc738a84b7946a87e8bfd3bb04869519b3dee Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Tue, 20 Nov 2012 20:36:49 -0800 Subject: BulletSim: enablement and debugging of mesh terrain. --- OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs index bab3b3d..a2271a9 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs @@ -391,13 +391,13 @@ public enum CollisionFilterGroups : uint ObjectFilter = BSolidFilter, ObjectMask = BAllFilter, StaticObjectFilter = BStaticFilter, - StaticObjectMask = BAllFilter, + StaticObjectMask = BAllFilter & ~BStaticFilter, // static objects don't collide with each other LinksetFilter = BLinksetFilter, - LinksetMask = BAllFilter & ~BLinksetFilter, + LinksetMask = BAllFilter & ~BLinksetFilter, // linkset objects don't collide with each other VolumeDetectFilter = BSensorTrigger, VolumeDetectMask = ~BSensorTrigger, TerrainFilter = BTerrainFilter, - TerrainMask = BAllFilter & ~BStaticFilter, + TerrainMask = BAllFilter & ~BStaticFilter, // static objects on the ground don't collide GroundPlaneFilter = BGroundPlaneFilter, GroundPlaneMask = BAllFilter -- cgit v1.1 From a59368c4a1889ccd79da9e564ee84b213a7f6fbd Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Wed, 21 Nov 2012 10:37:40 -0800 Subject: BulletSim: add terrainImplementation parameter with default to Mesh. --- OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs index a2271a9..e218053 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs @@ -283,6 +283,7 @@ public struct ConfigurationParameters public float ccdSweptSphereRadius; public float contactProcessingThreshold; + public float terrainImplementation; public float terrainFriction; public float terrainHitFraction; public float terrainRestitution; -- cgit v1.1 From cbc7e7bf85bfd9e916146b0ae4a605996c24720b Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Wed, 21 Nov 2012 16:31:23 -0800 Subject: BulletSim: Make avatar capsule so it is not circular. Simple attempt to make avatars better shaped. Replace parameter 'avatarCapsuleRadius' with 'avatarCapsuleWidth' and 'avatarCapsuleDepth'. More tweeking to avatar height calculation. A little better but short avatar's feet are above the terrain and tall avatar's feet are a little below the ground. --- OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs index e218053..4647c2d 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs @@ -291,7 +291,8 @@ public struct ConfigurationParameters public float avatarStandingFriction; public float avatarDensity; public float avatarRestitution; - public float avatarCapsuleRadius; + public float avatarCapsuleWidth; + public float avatarCapsuleDepth; public float avatarCapsuleHeight; public float avatarContactProcessingThreshold; -- cgit v1.1 From 3b2caa63b0ba890555990a88821ee37daa2607b4 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 22 Nov 2012 14:45:41 +0000 Subject: Rename BulletSim's PhysicsShapeType to BSPhysicsShapeType because it conflicts with PhysicsShape type defined in later libOMV --- OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs index 4647c2d..e60a760 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs @@ -88,11 +88,11 @@ public struct BulletShape public BulletShape(IntPtr xx) { ptr = xx; - type=PhysicsShapeType.SHAPE_UNKNOWN; + type=BSPhysicsShapeType.SHAPE_UNKNOWN; shapeKey = (System.UInt64)FixedShapeKey.KEY_NONE; isNativeShape = false; } - public BulletShape(IntPtr xx, PhysicsShapeType typ) + public BulletShape(IntPtr xx, BSPhysicsShapeType typ) { ptr = xx; type = typ; @@ -100,7 +100,7 @@ public struct BulletShape isNativeShape = false; } public IntPtr ptr; - public PhysicsShapeType type; + public BSPhysicsShapeType type; public System.UInt64 shapeKey; public bool isNativeShape; public override string ToString() @@ -178,7 +178,7 @@ public struct ConvexHull int VertexCount; Vector3[] Vertices; } -public enum PhysicsShapeType +public enum BSPhysicsShapeType { SHAPE_UNKNOWN = 0, SHAPE_CAPSULE = 1, @@ -210,7 +210,7 @@ public enum FixedShapeKey : ulong public struct ShapeData { public uint ID; - public PhysicsShapeType Type; + public BSPhysicsShapeType Type; public Vector3 Position; public Quaternion Rotation; public Vector3 Velocity; -- cgit v1.1