2014-07-14 01:13:49 +00:00
|
|
|
/********************************************************************************
|
2015-02-15 20:56:45 +00:00
|
|
|
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
2016-04-11 18:15:20 +00:00
|
|
|
* Copyright (c) 2010-2016 Daniel Chappuis *
|
2014-07-14 01:13:49 +00:00
|
|
|
*********************************************************************************
|
|
|
|
* *
|
|
|
|
* This software is provided 'as-is', without any express or implied warranty. *
|
|
|
|
* In no event will the authors be held liable for any damages arising from the *
|
|
|
|
* use of this software. *
|
|
|
|
* *
|
|
|
|
* Permission is granted to anyone to use this software for any purpose, *
|
|
|
|
* including commercial applications, and to alter it and redistribute it *
|
|
|
|
* freely, subject to the following restrictions: *
|
|
|
|
* *
|
|
|
|
* 1. The origin of this software must not be misrepresented; you must not claim *
|
|
|
|
* that you wrote the original software. If you use this software in a *
|
|
|
|
* product, an acknowledgment in the product documentation would be *
|
|
|
|
* appreciated but is not required. *
|
|
|
|
* *
|
|
|
|
* 2. Altered source versions must be plainly marked as such, and must not be *
|
|
|
|
* misrepresented as being the original software. *
|
|
|
|
* *
|
|
|
|
* 3. This notice may not be removed or altered from any source distribution. *
|
|
|
|
* *
|
|
|
|
********************************************************************************/
|
|
|
|
|
|
|
|
#ifndef TEST_POINT_INSIDE_H
|
|
|
|
#define TEST_POINT_INSIDE_H
|
|
|
|
|
|
|
|
// Libraries
|
2014-08-01 10:36:32 +00:00
|
|
|
#include "Test.h"
|
|
|
|
#include "collision/shapes/BoxShape.h"
|
|
|
|
#include "collision/shapes/SphereShape.h"
|
|
|
|
#include "collision/shapes/CapsuleShape.h"
|
|
|
|
#include "collision/shapes/ConvexMeshShape.h"
|
2018-04-20 05:13:39 +00:00
|
|
|
#include "engine/CollisionWorld.h"
|
|
|
|
#include "collision/PolygonVertexArray.h"
|
2014-07-14 01:13:49 +00:00
|
|
|
|
|
|
|
/// Reactphysics3D namespace
|
|
|
|
namespace reactphysics3d {
|
|
|
|
|
|
|
|
// Class TestPointInside
|
|
|
|
/**
|
|
|
|
* Unit test for the CollisionBody::testPointInside() method.
|
|
|
|
*/
|
|
|
|
class TestPointInside : public Test {
|
|
|
|
|
|
|
|
private :
|
|
|
|
|
|
|
|
// ---------- Atributes ---------- //
|
|
|
|
|
|
|
|
// Physics world
|
2014-08-01 10:36:32 +00:00
|
|
|
CollisionWorld* mWorld;
|
2014-07-14 01:13:49 +00:00
|
|
|
|
|
|
|
// Bodies
|
|
|
|
CollisionBody* mBoxBody;
|
|
|
|
CollisionBody* mSphereBody;
|
|
|
|
CollisionBody* mCapsuleBody;
|
|
|
|
CollisionBody* mConeBody;
|
|
|
|
CollisionBody* mConvexMeshBody;
|
|
|
|
CollisionBody* mConvexMeshBodyEdgesInfo;
|
|
|
|
CollisionBody* mCylinderBody;
|
|
|
|
CollisionBody* mCompoundBody;
|
|
|
|
|
2018-02-26 06:17:54 +00:00
|
|
|
Vector3 mConvexMeshCubeVertices[8];
|
|
|
|
int mConvexMeshCubeIndices[24];
|
|
|
|
PolygonVertexArray* mConvexMeshPolygonVertexArray;
|
|
|
|
PolyhedronMesh* mConvexMeshPolyhedronMesh;
|
|
|
|
PolygonVertexArray::PolygonFace* mConvexMeshPolygonFaces;
|
|
|
|
|
2015-09-04 17:56:27 +00:00
|
|
|
// Collision shapes
|
|
|
|
BoxShape* mBoxShape;
|
|
|
|
SphereShape* mSphereShape;
|
|
|
|
CapsuleShape* mCapsuleShape;
|
|
|
|
ConvexMeshShape* mConvexMeshShape;
|
|
|
|
|
2014-07-14 01:13:49 +00:00
|
|
|
// Transform
|
|
|
|
Transform mBodyTransform;
|
|
|
|
Transform mShapeTransform;
|
|
|
|
Transform mLocalShapeToWorld;
|
|
|
|
Transform mLocalShape2ToWorld;
|
|
|
|
|
2015-09-04 17:56:27 +00:00
|
|
|
// Proxy Shapes
|
|
|
|
ProxyShape* mBoxProxyShape;
|
|
|
|
ProxyShape* mSphereProxyShape;
|
|
|
|
ProxyShape* mCapsuleProxyShape;
|
|
|
|
ProxyShape* mConvexMeshProxyShape;
|
2014-07-14 01:13:49 +00:00
|
|
|
|
|
|
|
public :
|
|
|
|
|
|
|
|
// ---------- Methods ---------- //
|
|
|
|
|
|
|
|
/// Constructor
|
2014-08-09 08:27:41 +00:00
|
|
|
TestPointInside(const std::string& name) : Test(name) {
|
2014-07-14 01:13:49 +00:00
|
|
|
|
|
|
|
// Create the world
|
2014-08-01 10:36:32 +00:00
|
|
|
mWorld = new CollisionWorld();
|
2014-07-14 01:13:49 +00:00
|
|
|
|
|
|
|
// Body transform
|
|
|
|
Vector3 position(-3, 2, 7);
|
2017-11-28 16:26:13 +00:00
|
|
|
Quaternion orientation = Quaternion::fromEulerAngles(PI / 5, PI / 6, PI / 7);
|
2014-09-02 20:54:19 +00:00
|
|
|
mBodyTransform = Transform(position, orientation);
|
2014-07-14 01:13:49 +00:00
|
|
|
|
|
|
|
// Create the bodies
|
2014-08-01 10:36:32 +00:00
|
|
|
mBoxBody = mWorld->createCollisionBody(mBodyTransform);
|
|
|
|
mSphereBody = mWorld->createCollisionBody(mBodyTransform);
|
|
|
|
mCapsuleBody = mWorld->createCollisionBody(mBodyTransform);
|
|
|
|
mConeBody = mWorld->createCollisionBody(mBodyTransform);
|
|
|
|
mConvexMeshBody = mWorld->createCollisionBody(mBodyTransform);
|
|
|
|
mConvexMeshBodyEdgesInfo = mWorld->createCollisionBody(mBodyTransform);
|
|
|
|
mCylinderBody = mWorld->createCollisionBody(mBodyTransform);
|
2018-02-26 06:17:54 +00:00
|
|
|
mConvexMeshBody = mWorld->createCollisionBody(mBodyTransform);
|
2014-08-09 08:27:41 +00:00
|
|
|
mCompoundBody = mWorld->createCollisionBody(mBodyTransform);
|
2014-07-14 01:13:49 +00:00
|
|
|
|
|
|
|
// Collision shape transform
|
|
|
|
Vector3 shapePosition(1, -4, -3);
|
2017-11-28 16:26:13 +00:00
|
|
|
Quaternion shapeOrientation = Quaternion::fromEulerAngles(3 * PI / 6 , -PI / 8, PI / 3);
|
2014-09-02 20:54:19 +00:00
|
|
|
mShapeTransform = Transform(shapePosition, shapeOrientation);
|
2014-07-14 01:13:49 +00:00
|
|
|
|
|
|
|
// Compute the the transform from a local shape point to world-space
|
|
|
|
mLocalShapeToWorld = mBodyTransform * mShapeTransform;
|
|
|
|
|
|
|
|
// Create collision shapes
|
2017-09-03 17:06:02 +00:00
|
|
|
mBoxShape = new BoxShape(Vector3(2, 3, 4));
|
2015-09-04 17:56:27 +00:00
|
|
|
mBoxProxyShape = mBoxBody->addCollisionShape(mBoxShape, mShapeTransform);
|
|
|
|
|
|
|
|
mSphereShape = new SphereShape(3);
|
|
|
|
mSphereProxyShape = mSphereBody->addCollisionShape(mSphereShape, mShapeTransform);
|
|
|
|
|
2018-02-26 06:17:54 +00:00
|
|
|
mCapsuleShape = new CapsuleShape(3, 10);
|
2015-09-04 17:56:27 +00:00
|
|
|
mCapsuleProxyShape = mCapsuleBody->addCollisionShape(mCapsuleShape, mShapeTransform);
|
|
|
|
|
2018-02-26 06:17:54 +00:00
|
|
|
mConvexMeshCubeVertices[0] = Vector3(-2, -3, 4);
|
|
|
|
mConvexMeshCubeVertices[1] = Vector3(2, -3, 4);
|
|
|
|
mConvexMeshCubeVertices[2] = Vector3(2, -3, -4);
|
|
|
|
mConvexMeshCubeVertices[3] = Vector3(-2, -3, -4);
|
|
|
|
mConvexMeshCubeVertices[4] = Vector3(-2, 3, 4);
|
|
|
|
mConvexMeshCubeVertices[5] = Vector3(2, 3, 4);
|
|
|
|
mConvexMeshCubeVertices[6] = Vector3(2, 3, -4);
|
|
|
|
mConvexMeshCubeVertices[7] = Vector3(-2, 3, -4);
|
|
|
|
|
|
|
|
mConvexMeshCubeIndices[0] = 0; mConvexMeshCubeIndices[1] = 3; mConvexMeshCubeIndices[2] = 2; mConvexMeshCubeIndices[3] = 1;
|
|
|
|
mConvexMeshCubeIndices[4] = 4; mConvexMeshCubeIndices[5] = 5; mConvexMeshCubeIndices[6] = 6; mConvexMeshCubeIndices[7] = 7;
|
|
|
|
mConvexMeshCubeIndices[8] = 0; mConvexMeshCubeIndices[9] = 1; mConvexMeshCubeIndices[10] = 5; mConvexMeshCubeIndices[11] = 4;
|
|
|
|
mConvexMeshCubeIndices[12] = 1; mConvexMeshCubeIndices[13] = 2; mConvexMeshCubeIndices[14] = 6; mConvexMeshCubeIndices[15] = 5;
|
|
|
|
mConvexMeshCubeIndices[16] = 2; mConvexMeshCubeIndices[17] = 3; mConvexMeshCubeIndices[18] = 7; mConvexMeshCubeIndices[19] = 6;
|
|
|
|
mConvexMeshCubeIndices[20] = 0; mConvexMeshCubeIndices[21] = 4; mConvexMeshCubeIndices[22] = 7; mConvexMeshCubeIndices[23] = 3;
|
|
|
|
|
|
|
|
mConvexMeshPolygonFaces = new PolygonVertexArray::PolygonFace[6];
|
|
|
|
PolygonVertexArray::PolygonFace* face = mConvexMeshPolygonFaces;
|
|
|
|
for (int f = 0; f < 6; f++) {
|
|
|
|
face->indexBase = f * 4;
|
|
|
|
face->nbVertices = 4;
|
|
|
|
face++;
|
|
|
|
}
|
|
|
|
mConvexMeshPolygonVertexArray = new PolygonVertexArray(8, &(mConvexMeshCubeVertices[0]), sizeof(Vector3),
|
|
|
|
&(mConvexMeshCubeIndices[0]), sizeof(int), 6, mConvexMeshPolygonFaces,
|
|
|
|
PolygonVertexArray::VertexDataType::VERTEX_FLOAT_TYPE,
|
|
|
|
PolygonVertexArray::IndexDataType::INDEX_INTEGER_TYPE);
|
|
|
|
mConvexMeshPolyhedronMesh = new PolyhedronMesh(mConvexMeshPolygonVertexArray);
|
|
|
|
mConvexMeshShape = new ConvexMeshShape(mConvexMeshPolyhedronMesh);
|
|
|
|
Transform convexMeshTransform(Vector3(10, 0, 0), Quaternion::identity());
|
2015-09-04 17:56:27 +00:00
|
|
|
mConvexMeshProxyShape = mConvexMeshBody->addCollisionShape(mConvexMeshShape, mShapeTransform);
|
|
|
|
|
2017-02-02 21:58:40 +00:00
|
|
|
// Compound shape is a capsule and a sphere
|
2014-07-14 01:13:49 +00:00
|
|
|
Vector3 positionShape2(Vector3(4, 2, -3));
|
2018-02-26 06:17:54 +00:00
|
|
|
Quaternion orientationShape2 = Quaternion::fromEulerAngles(-3 * PI / 8, 1.5 * PI/ 3, PI / 13);
|
2014-07-14 01:13:49 +00:00
|
|
|
Transform shapeTransform2(positionShape2, orientationShape2);
|
|
|
|
mLocalShape2ToWorld = mBodyTransform * shapeTransform2;
|
2017-02-02 21:58:40 +00:00
|
|
|
mCompoundBody->addCollisionShape(mCapsuleShape, mShapeTransform);
|
2015-09-04 17:56:27 +00:00
|
|
|
mCompoundBody->addCollisionShape(mSphereShape, shapeTransform2);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Destructor
|
2017-02-20 15:11:13 +00:00
|
|
|
virtual ~TestPointInside() {
|
2018-03-29 05:40:24 +00:00
|
|
|
delete mWorld;
|
2015-09-04 17:56:27 +00:00
|
|
|
delete mBoxShape;
|
|
|
|
delete mSphereShape;
|
|
|
|
delete mCapsuleShape;
|
2018-02-26 06:17:54 +00:00
|
|
|
delete mConvexMeshShape;
|
2018-03-29 05:40:24 +00:00
|
|
|
delete[] mConvexMeshPolygonFaces;
|
2018-02-26 06:17:54 +00:00
|
|
|
delete mConvexMeshPolygonVertexArray;
|
|
|
|
delete mConvexMeshPolyhedronMesh;
|
2014-07-14 01:13:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// Run the tests
|
|
|
|
void run() {
|
|
|
|
testBox();
|
|
|
|
testSphere();
|
|
|
|
testCapsule();
|
|
|
|
testConvexMesh();
|
|
|
|
testCompound();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Test the ProxyBoxShape::testPointInside() and
|
|
|
|
/// CollisionBody::testPointInside() methods
|
|
|
|
void testBox() {
|
|
|
|
|
|
|
|
// Tests with CollisionBody
|
2018-08-05 14:10:13 +00:00
|
|
|
rp3d_test(mBoxBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 0)));
|
|
|
|
rp3d_test(mBoxBody->testPointInside(mLocalShapeToWorld * Vector3(-1.9, 0, 0)));
|
|
|
|
rp3d_test(mBoxBody->testPointInside(mLocalShapeToWorld * Vector3(1.9, 0, 0)));
|
|
|
|
rp3d_test(mBoxBody->testPointInside(mLocalShapeToWorld * Vector3(0, -2.9, 0)));
|
|
|
|
rp3d_test(mBoxBody->testPointInside(mLocalShapeToWorld * Vector3(0, 2.9, 0)));
|
|
|
|
rp3d_test(mBoxBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, -3.9)));
|
|
|
|
rp3d_test(mBoxBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 3.9)));
|
|
|
|
rp3d_test(mBoxBody->testPointInside(mLocalShapeToWorld * Vector3(-1.9, -2.9, -3.9)));
|
|
|
|
rp3d_test(mBoxBody->testPointInside(mLocalShapeToWorld * Vector3(1.9, 2.9, 3.9)));
|
|
|
|
rp3d_test(mBoxBody->testPointInside(mLocalShapeToWorld * Vector3(-1, -2, -1.5)));
|
|
|
|
rp3d_test(mBoxBody->testPointInside(mLocalShapeToWorld * Vector3(-1, 2, -2.5)));
|
|
|
|
rp3d_test(mBoxBody->testPointInside(mLocalShapeToWorld * Vector3(1, -2, 3.5)));
|
|
|
|
|
|
|
|
rp3d_test(!mBoxBody->testPointInside(mLocalShapeToWorld * Vector3(-2.1, 0, 0)));
|
|
|
|
rp3d_test(!mBoxBody->testPointInside(mLocalShapeToWorld * Vector3(2.1, 0, 0)));
|
|
|
|
rp3d_test(!mBoxBody->testPointInside(mLocalShapeToWorld * Vector3(0, -3.1, 0)));
|
|
|
|
rp3d_test(!mBoxBody->testPointInside(mLocalShapeToWorld * Vector3(0, 3.1, 0)));
|
|
|
|
rp3d_test(!mBoxBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, -4.1)));
|
|
|
|
rp3d_test(!mBoxBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 4.1)));
|
|
|
|
rp3d_test(!mBoxBody->testPointInside(mLocalShapeToWorld * Vector3(-2.1, -3.1, -4.1)));
|
|
|
|
rp3d_test(!mBoxBody->testPointInside(mLocalShapeToWorld * Vector3(2.1, 3.1, 4.1)));
|
|
|
|
rp3d_test(!mBoxBody->testPointInside(mLocalShapeToWorld * Vector3(-10, -2, -1.5)));
|
|
|
|
rp3d_test(!mBoxBody->testPointInside(mLocalShapeToWorld * Vector3(-1, 4, -2.5)));
|
|
|
|
rp3d_test(!mBoxBody->testPointInside(mLocalShapeToWorld * Vector3(1, -2, 4.5)));
|
2014-07-14 01:13:49 +00:00
|
|
|
|
|
|
|
// Tests with ProxyBoxShape
|
2018-08-05 14:10:13 +00:00
|
|
|
rp3d_test(mBoxProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 0)));
|
|
|
|
rp3d_test(mBoxProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-1.9, 0, 0)));
|
|
|
|
rp3d_test(mBoxProxyShape->testPointInside(mLocalShapeToWorld * Vector3(1.9, 0, 0)));
|
|
|
|
rp3d_test(mBoxProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, -2.9, 0)));
|
|
|
|
rp3d_test(mBoxProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 2.9, 0)));
|
|
|
|
rp3d_test(mBoxProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 0, -3.9)));
|
|
|
|
rp3d_test(mBoxProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 3.9)));
|
|
|
|
rp3d_test(mBoxProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-1.9, -2.9, -3.9)));
|
|
|
|
rp3d_test(mBoxProxyShape->testPointInside(mLocalShapeToWorld * Vector3(1.9, 2.9, 3.9)));
|
|
|
|
rp3d_test(mBoxProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-1, -2, -1.5)));
|
|
|
|
rp3d_test(mBoxProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-1, 2, -2.5)));
|
|
|
|
rp3d_test(mBoxProxyShape->testPointInside(mLocalShapeToWorld * Vector3(1, -2, 3.5)));
|
|
|
|
|
|
|
|
rp3d_test(!mBoxProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-2.1, 0, 0)));
|
|
|
|
rp3d_test(!mBoxProxyShape->testPointInside(mLocalShapeToWorld * Vector3(2.1, 0, 0)));
|
|
|
|
rp3d_test(!mBoxProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, -3.1, 0)));
|
|
|
|
rp3d_test(!mBoxProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 3.1, 0)));
|
|
|
|
rp3d_test(!mBoxProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 0, -4.1)));
|
|
|
|
rp3d_test(!mBoxProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 4.1)));
|
|
|
|
rp3d_test(!mBoxProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-2.1, -3.1, -4.1)));
|
|
|
|
rp3d_test(!mBoxProxyShape->testPointInside(mLocalShapeToWorld * Vector3(2.1, 3.1, 4.1)));
|
|
|
|
rp3d_test(!mBoxProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-10, -2, -1.5)));
|
|
|
|
rp3d_test(!mBoxProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-1, 4, -2.5)));
|
|
|
|
rp3d_test(!mBoxProxyShape->testPointInside(mLocalShapeToWorld * Vector3(1, -2, 4.5)));
|
2014-07-14 01:13:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// Test the ProxySphereShape::testPointInside() and
|
|
|
|
/// CollisionBody::testPointInside() methods
|
|
|
|
void testSphere() {
|
|
|
|
|
|
|
|
// Tests with CollisionBody
|
2018-08-05 14:10:13 +00:00
|
|
|
rp3d_test(mSphereBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 0)));
|
|
|
|
rp3d_test(mSphereBody->testPointInside(mLocalShapeToWorld * Vector3(2.9, 0, 0)));
|
|
|
|
rp3d_test(mSphereBody->testPointInside(mLocalShapeToWorld * Vector3(-2.9, 0, 0)));
|
|
|
|
rp3d_test(mSphereBody->testPointInside(mLocalShapeToWorld * Vector3(0, 2.9, 0)));
|
|
|
|
rp3d_test(mSphereBody->testPointInside(mLocalShapeToWorld * Vector3(0, -2.9, 0)));
|
|
|
|
rp3d_test(mSphereBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 2.9)));
|
|
|
|
rp3d_test(mSphereBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 2.9)));
|
|
|
|
rp3d_test(mSphereBody->testPointInside(mLocalShapeToWorld * Vector3(-1, -2, -1.5)));
|
|
|
|
rp3d_test(mSphereBody->testPointInside(mLocalShapeToWorld * Vector3(-1, 2, -1.5)));
|
|
|
|
rp3d_test(mSphereBody->testPointInside(mLocalShapeToWorld * Vector3(1, -2, 1.5)));
|
|
|
|
|
|
|
|
rp3d_test(!mSphereBody->testPointInside(mLocalShapeToWorld * Vector3(3.1, 0, 0)));
|
|
|
|
rp3d_test(!mSphereBody->testPointInside(mLocalShapeToWorld * Vector3(-3.1, 0, 0)));
|
|
|
|
rp3d_test(!mSphereBody->testPointInside(mLocalShapeToWorld * Vector3(0, 3.1, 0)));
|
|
|
|
rp3d_test(!mSphereBody->testPointInside(mLocalShapeToWorld * Vector3(0, -3.1, 0)));
|
|
|
|
rp3d_test(!mSphereBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 3.1)));
|
|
|
|
rp3d_test(!mSphereBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, -3.1)));
|
|
|
|
rp3d_test(!mSphereBody->testPointInside(mLocalShapeToWorld * Vector3(-2, -2, -2)));
|
|
|
|
rp3d_test(!mSphereBody->testPointInside(mLocalShapeToWorld * Vector3(-2, 2, -1.5)));
|
|
|
|
rp3d_test(!mSphereBody->testPointInside(mLocalShapeToWorld * Vector3(1.5, -2, 2.5)));
|
2014-07-14 01:13:49 +00:00
|
|
|
|
|
|
|
// Tests with ProxySphereShape
|
2018-08-05 14:10:13 +00:00
|
|
|
rp3d_test(mSphereProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 0)));
|
|
|
|
rp3d_test(mSphereProxyShape->testPointInside(mLocalShapeToWorld * Vector3(2.9, 0, 0)));
|
|
|
|
rp3d_test(mSphereProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-2.9, 0, 0)));
|
|
|
|
rp3d_test(mSphereProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 2.9, 0)));
|
|
|
|
rp3d_test(mSphereProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, -2.9, 0)));
|
|
|
|
rp3d_test(mSphereProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 2.9)));
|
|
|
|
rp3d_test(mSphereProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 2.9)));
|
|
|
|
rp3d_test(mSphereProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-1, -2, -1.5)));
|
|
|
|
rp3d_test(mSphereProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-1, 2, -1.5)));
|
|
|
|
rp3d_test(mSphereProxyShape->testPointInside(mLocalShapeToWorld * Vector3(1, -2, 1.5)));
|
|
|
|
|
|
|
|
rp3d_test(!mSphereProxyShape->testPointInside(mLocalShapeToWorld * Vector3(3.1, 0, 0)));
|
|
|
|
rp3d_test(!mSphereProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-3.1, 0, 0)));
|
|
|
|
rp3d_test(!mSphereProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 3.1, 0)));
|
|
|
|
rp3d_test(!mSphereProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, -3.1, 0)));
|
|
|
|
rp3d_test(!mSphereProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 3.1)));
|
|
|
|
rp3d_test(!mSphereProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 0, -3.1)));
|
|
|
|
rp3d_test(!mSphereProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-2, -2, -2)));
|
|
|
|
rp3d_test(!mSphereProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-2, 2, -1.5)));
|
|
|
|
rp3d_test(!mSphereProxyShape->testPointInside(mLocalShapeToWorld * Vector3(1.5, -2, 2.5)));
|
2014-07-14 01:13:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// Test the ProxyCapsuleShape::testPointInside() and
|
|
|
|
/// CollisionBody::testPointInside() methods
|
|
|
|
void testCapsule() {
|
|
|
|
|
|
|
|
// Tests with CollisionBody
|
2018-08-05 14:10:13 +00:00
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 0)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0, 5, 0)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0, -5, 0)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0, -6.9, 0)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0, 6.9, 0)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 1.9)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, -1.9)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(1.9, 0, 0)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(-1.9, 0, 0)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0.9, 0, 0.9)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0.9, 0, -0.9)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0, 5, 1.9)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0, 5, -1.9)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(1.9, 5, 0)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(-1.9, 5, 0)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0.9, 5, 0.9)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0.9, 5, -0.9)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0, -5, 1.9)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0, -5, -1.9)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(1.9, -5, 0)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(-1.9, -5, 0)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0.9, -5, 0.9)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0.9, -5, -0.9)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(-1.7, -4, -0.9)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(-1, 2, 0.4)));
|
|
|
|
rp3d_test(mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(1.3, 1, 1.5)));
|
|
|
|
|
|
|
|
rp3d_test(!mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0, -13.1, 0)));
|
|
|
|
rp3d_test(!mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0, 13.1, 0)));
|
|
|
|
rp3d_test(!mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 3.1)));
|
|
|
|
rp3d_test(!mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, -3.1)));
|
|
|
|
rp3d_test(!mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(3.1, 0, 0)));
|
|
|
|
rp3d_test(!mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(-3.1, 0, 0)));
|
|
|
|
rp3d_test(!mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0, 5, 3.1)));
|
|
|
|
rp3d_test(!mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0, 5, -3.1)));
|
|
|
|
rp3d_test(!mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(3.1, 5, 0)));
|
|
|
|
rp3d_test(!mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(-3.1, 5, 0)));
|
|
|
|
rp3d_test(!mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(2.5, 5, 2.6)));
|
|
|
|
rp3d_test(!mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(2.5, 5, -2.7)));
|
|
|
|
rp3d_test(!mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0, -5, 3.1)));
|
|
|
|
rp3d_test(!mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(0, -5, -3.1)));
|
|
|
|
rp3d_test(!mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(3.1, -5, 0)));
|
|
|
|
rp3d_test(!mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(-3.1, -5, 0)));
|
|
|
|
rp3d_test(!mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(2.5, -5, 2.6)));
|
|
|
|
rp3d_test(!mCapsuleBody->testPointInside(mLocalShapeToWorld * Vector3(2.5, -5, -2.7)));
|
2014-07-14 01:13:49 +00:00
|
|
|
|
|
|
|
// Tests with ProxyCapsuleShape
|
2018-08-05 14:10:13 +00:00
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 0)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 5, 0)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, -5, 0)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, -6.9, 0)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 6.9, 0)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 1.9)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 0, -1.9)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(1.9, 0, 0)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-1.9, 0, 0)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0.9, 0, 0.9)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0.9, 0, -0.9)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 5, 1.9)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 5, -1.9)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(1.9, 5, 0)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-1.9, 5, 0)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0.9, 5, 0.9)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0.9, 5, -0.9)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, -5, 1.9)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, -5, -1.9)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(1.9, -5, 0)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-1.9, -5, 0)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0.9, -5, 0.9)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0.9, -5, -0.9)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-1.7, -4, -0.9)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-1, 2, 0.4)));
|
|
|
|
rp3d_test(mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(1.3, 1, 1.5)));
|
|
|
|
|
|
|
|
rp3d_test(!mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, -13.1, 0)));
|
|
|
|
rp3d_test(!mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 13.1, 0)));
|
|
|
|
rp3d_test(!mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 3.1)));
|
|
|
|
rp3d_test(!mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 0, -3.1)));
|
|
|
|
rp3d_test(!mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(3.1, 0, 0)));
|
|
|
|
rp3d_test(!mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-3.1, 0, 0)));
|
|
|
|
rp3d_test(!mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 5, 3.1)));
|
|
|
|
rp3d_test(!mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 5, -3.1)));
|
|
|
|
rp3d_test(!mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(3.1, 5, 0)));
|
|
|
|
rp3d_test(!mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-3.1, 5, 0)));
|
|
|
|
rp3d_test(!mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(2.5, 5, 2.6)));
|
|
|
|
rp3d_test(!mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(2.5, 5, -2.7)));
|
|
|
|
rp3d_test(!mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, -5, 3.1)));
|
|
|
|
rp3d_test(!mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, -5, -3.1)));
|
|
|
|
rp3d_test(!mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(3.1, -5, 0)));
|
|
|
|
rp3d_test(!mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-3.1, -5, 0)));
|
|
|
|
rp3d_test(!mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(2.5, -5, 2.6)));
|
|
|
|
rp3d_test(!mCapsuleProxyShape->testPointInside(mLocalShapeToWorld * Vector3(2.5, -5, -2.7)));
|
2014-07-14 01:13:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// Test the ProxyConvexMeshShape::testPointInside() and
|
|
|
|
/// CollisionBody::testPointInside() methods
|
|
|
|
void testConvexMesh() {
|
|
|
|
|
|
|
|
// Tests with CollisionBody
|
2018-08-05 14:10:13 +00:00
|
|
|
rp3d_test(mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 0)));
|
|
|
|
rp3d_test(mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(-1.9, 0, 0)));
|
|
|
|
rp3d_test(mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(1.9, 0, 0)));
|
|
|
|
rp3d_test(mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(0, -2.9, 0)));
|
|
|
|
rp3d_test(mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(0, 2.9, 0)));
|
|
|
|
rp3d_test(mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, -3.9)));
|
|
|
|
rp3d_test(mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 3.9)));
|
|
|
|
rp3d_test(mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(-1.9, -2.9, -3.9)));
|
|
|
|
rp3d_test(mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(1.9, 2.9, 3.9)));
|
|
|
|
rp3d_test(mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(-1, -2, -1.5)));
|
|
|
|
rp3d_test(mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(-1, 2, -2.5)));
|
|
|
|
rp3d_test(mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(1, -2, 3.5)));
|
|
|
|
|
|
|
|
rp3d_test(!mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(-2.1, 0, 0)));
|
|
|
|
rp3d_test(!mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(2.1, 0, 0)));
|
|
|
|
rp3d_test(!mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(0, -3.1, 0)));
|
|
|
|
rp3d_test(!mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(0, 3.1, 0)));
|
|
|
|
rp3d_test(!mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, -4.1)));
|
|
|
|
rp3d_test(!mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 4.1)));
|
|
|
|
rp3d_test(!mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(-2.1, -3.1, -4.1)));
|
|
|
|
rp3d_test(!mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(2.1, 3.1, 4.1)));
|
|
|
|
rp3d_test(!mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(-10, -2, -1.5)));
|
|
|
|
rp3d_test(!mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(-1, 4, -2.5)));
|
|
|
|
rp3d_test(!mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(1, -2, 4.5)));
|
2014-07-14 01:13:49 +00:00
|
|
|
|
|
|
|
// Tests with ProxyConvexMeshShape
|
2018-08-05 14:10:13 +00:00
|
|
|
rp3d_test(mConvexMeshProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 0)));
|
|
|
|
rp3d_test(mConvexMeshProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-1.9, 0, 0)));
|
|
|
|
rp3d_test(mConvexMeshProxyShape->testPointInside(mLocalShapeToWorld * Vector3(1.9, 0, 0)));
|
|
|
|
rp3d_test(mConvexMeshProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, -2.9, 0)));
|
|
|
|
rp3d_test(mConvexMeshProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 2.9, 0)));
|
|
|
|
rp3d_test(mConvexMeshProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 0, -3.9)));
|
|
|
|
rp3d_test(mConvexMeshProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 3.9)));
|
|
|
|
rp3d_test(mConvexMeshProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-1.9, -2.9, -3.9)));
|
|
|
|
rp3d_test(mConvexMeshProxyShape->testPointInside(mLocalShapeToWorld * Vector3(1.9, 2.9, 3.9)));
|
|
|
|
rp3d_test(mConvexMeshProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-1, -2, -1.5)));
|
|
|
|
rp3d_test(mConvexMeshProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-1, 2, -2.5)));
|
|
|
|
rp3d_test(mConvexMeshProxyShape->testPointInside(mLocalShapeToWorld * Vector3(1, -2, 3.5)));
|
|
|
|
|
|
|
|
rp3d_test(!mConvexMeshProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-2.1, 0, 0)));
|
|
|
|
rp3d_test(!mConvexMeshProxyShape->testPointInside(mLocalShapeToWorld * Vector3(2.1, 0, 0)));
|
|
|
|
rp3d_test(!mConvexMeshProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, -3.1, 0)));
|
|
|
|
rp3d_test(!mConvexMeshProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 3.1, 0)));
|
|
|
|
rp3d_test(!mConvexMeshProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 0, -4.1)));
|
|
|
|
rp3d_test(!mConvexMeshProxyShape->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 4.1)));
|
|
|
|
rp3d_test(!mConvexMeshProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-2.1, -3.1, -4.1)));
|
|
|
|
rp3d_test(!mConvexMeshProxyShape->testPointInside(mLocalShapeToWorld * Vector3(2.1, 3.1, 4.1)));
|
|
|
|
rp3d_test(!mConvexMeshProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-10, -2, -1.5)));
|
|
|
|
rp3d_test(!mConvexMeshProxyShape->testPointInside(mLocalShapeToWorld * Vector3(-1, 4, -2.5)));
|
|
|
|
rp3d_test(!mConvexMeshProxyShape->testPointInside(mLocalShapeToWorld * Vector3(1, -2, 4.5)));
|
2014-07-14 01:13:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// Test the CollisionBody::testPointInside() method
|
|
|
|
void testCompound() {
|
|
|
|
|
2017-02-02 21:58:40 +00:00
|
|
|
// Points on the capsule
|
2018-08-05 14:10:13 +00:00
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 0)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(0, 3.9, 0)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(0, -3.9, 0)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(2.9, 0, 0)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(-2.9, 0, 0)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 2.9)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, -2.9)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(1.7, 0, 1.7)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(1.7, 0, -1.7)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(-1.7, 0, -1.7)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(-1.7, 0, 1.7)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(2.9, 3.9, 0)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(-2.9, 3.9, 0)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(0, 3.9, 2.9)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(0, 3.9, -2.9)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(1.7, 3.9, 1.7)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(1.7, 3.9, -1.7)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(-1.7, 3.9, -1.7)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(-1.7, 3.9, 1.7)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(2.9, -3.9, 0)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(-2.9, -3.9, 0)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(0, -3.9, 2.9)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(0, -3.9, -2.9)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(1.7, -3.9, 1.7)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(1.7, -3.9, -1.7)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(-1.7, -3.9, -1.7)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShapeToWorld * Vector3(-1.7, -3.9, 1.7)));
|
2014-07-14 01:13:49 +00:00
|
|
|
|
|
|
|
// Points on the sphere
|
2018-08-05 14:10:13 +00:00
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShape2ToWorld * Vector3(0, 0, 0)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShape2ToWorld * Vector3(2.9, 0, 0)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShape2ToWorld * Vector3(-2.9, 0, 0)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShape2ToWorld * Vector3(0, 2.9, 0)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShape2ToWorld * Vector3(0, -2.9, 0)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShape2ToWorld * Vector3(0, 0, 2.9)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShape2ToWorld * Vector3(0, 0, 2.9)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShape2ToWorld * Vector3(-1, -2, -1.5)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShape2ToWorld * Vector3(-1, 2, -1.5)));
|
|
|
|
rp3d_test(mCompoundBody->testPointInside(mLocalShape2ToWorld * Vector3(1, -2, 1.5)));
|
2014-07-14 01:13:49 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|