diff options
author | Robert Adams | 2012-12-29 21:43:43 -0800 |
---|---|---|
committer | Robert Adams | 2012-12-31 19:57:21 -0800 |
commit | 48f718f39fcd61501262878a8bcfbd98efed29d2 (patch) | |
tree | aa67dbaf54d75152f01302921bbc42226daaec8b /OpenSim/Region/Physics/BulletSPlugin/BSTerrainMesh.cs | |
parent | BulletSim: change physical data structures to classes. Add default (diff) | |
download | opensim-SC-48f718f39fcd61501262878a8bcfbd98efed29d2.zip opensim-SC-48f718f39fcd61501262878a8bcfbd98efed29d2.tar.gz opensim-SC-48f718f39fcd61501262878a8bcfbd98efed29d2.tar.bz2 opensim-SC-48f718f39fcd61501262878a8bcfbd98efed29d2.tar.xz |
BulletSim: first round of conversion from direct BulletSimAPI interfacing by BulletSim core to using the BulletSimAPITemplate. Physical object creation and destruction first.
Diffstat (limited to '')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSTerrainMesh.cs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainMesh.cs b/OpenSim/Region/Physics/BulletSPlugin/BSTerrainMesh.cs index 061e232..d8c4972 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainMesh.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSTerrainMesh.cs | |||
@@ -91,9 +91,7 @@ public sealed class BSTerrainMesh : BSTerrainPhys | |||
91 | PhysicsScene.DetailLog("{0},BSTerrainMesh.create,meshed,indices={1},indSz={2},vertices={3},vertSz={4}", | 91 | PhysicsScene.DetailLog("{0},BSTerrainMesh.create,meshed,indices={1},indSz={2},vertices={3},vertSz={4}", |
92 | ID, indicesCount, indices.Length, verticesCount, vertices.Length); | 92 | ID, indicesCount, indices.Length, verticesCount, vertices.Length); |
93 | 93 | ||
94 | m_terrainShape = new BulletShape(BulletSimAPI.CreateMeshShape2(PhysicsScene.World.ptr, | 94 | m_terrainShape = PhysicsScene.PE.CreateMeshShape(PhysicsScene.World, indicesCount, indices, verticesCount, vertices); |
95 | indicesCount, indices, verticesCount, vertices), | ||
96 | BSPhysicsShapeType.SHAPE_MESH); | ||
97 | if (!m_terrainShape.HasPhysicalShape) | 95 | if (!m_terrainShape.HasPhysicalShape) |
98 | { | 96 | { |
99 | // DISASTER!! | 97 | // DISASTER!! |
@@ -106,7 +104,7 @@ public sealed class BSTerrainMesh : BSTerrainPhys | |||
106 | Vector3 pos = regionBase; | 104 | Vector3 pos = regionBase; |
107 | Quaternion rot = Quaternion.Identity; | 105 | Quaternion rot = Quaternion.Identity; |
108 | 106 | ||
109 | m_terrainBody = new BulletBody(id, BulletSimAPI.CreateBodyWithDefaultMotionState2( m_terrainShape.ptr, ID, pos, rot)); | 107 | m_terrainBody = PhysicsScene.PE.CreateBodyWithDefaultMotionState(m_terrainShape, ID, pos, rot); |
110 | if (!m_terrainBody.HasPhysicalBody) | 108 | if (!m_terrainBody.HasPhysicalBody) |
111 | { | 109 | { |
112 | // DISASTER!! | 110 | // DISASTER!! |
@@ -143,7 +141,7 @@ public sealed class BSTerrainMesh : BSTerrainPhys | |||
143 | { | 141 | { |
144 | BulletSimAPI.RemoveObjectFromWorld2(PhysicsScene.World.ptr, m_terrainBody.ptr); | 142 | BulletSimAPI.RemoveObjectFromWorld2(PhysicsScene.World.ptr, m_terrainBody.ptr); |
145 | // Frees both the body and the shape. | 143 | // Frees both the body and the shape. |
146 | BulletSimAPI.DestroyObject2(PhysicsScene.World.ptr, m_terrainBody.ptr); | 144 | PhysicsScene.PE.DestroyObject(PhysicsScene.World, m_terrainBody); |
147 | } | 145 | } |
148 | } | 146 | } |
149 | 147 | ||