From bb00363333b22bba17de1ed19b28922505ee1a0a Mon Sep 17 00:00:00 2001 From: Lubos Lenco Date: Sat, 7 May 2016 00:32:52 +0200 Subject: [PATCH] Fixed static mesh collision for cpp. --- Sources/cycles/trait/RigidBody.hx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Sources/cycles/trait/RigidBody.hx b/Sources/cycles/trait/RigidBody.hx index e500f86b..ef6c6f51 100644 --- a/Sources/cycles/trait/RigidBody.hx +++ b/Sources/cycles/trait/RigidBody.hx @@ -104,11 +104,8 @@ class RigidBody extends Trait { withMargin(transform.size.z));// * scaleZ); // Height } //else if (shape == SHAPE_TERRAIN) { - // throw "Terrain not yet supported, use static mesh instead."; - /* - var data:Array = []; - _shape = BtHeightfieldTerrainShape.create(3, 3, data, 1, -10, 10, 2, 0, true); - */ + // var data:Array = []; + // _shape = BtHeightfieldTerrainShape.create(3, 3, data, 1, -10, 10, 2, 0, true); //} else if (shape == SHAPE_STATIC_MESH || shape == SHAPE_TERRAIN) { var meshInterface = BtTriangleMesh.create(true, true); @@ -252,7 +249,7 @@ class RigidBody extends Trait { var indices = cast(node, ModelNode).resource.geometry.indices; for (i in 0...Std.int(indices[0].length / 3)) { - triangleMesh.value.addTriangle( + triangleMesh.ptr.addTriangle( BtVector3.create(positions[indices[0][i * 3 + 0] * 3 + 0], positions[indices[0][i * 3 + 0] * 3 + 1], positions[indices[0][i * 3 + 0] * 3 + 2]).value,