Exemplo n.º 1
0
void LinearConvexCastDemo::initPhysics()
{
	setCameraDistance(30.f);
	tr[0].setOrigin(SimdVector3(0,0,0));
	tr[1].setOrigin(SimdVector3(0,10,0));

	SimdMatrix3x3 basisA;
	basisA.setValue(0.99999958f,0.00022980258f,0.00090992288f,
		-0.00029313788f,0.99753088f,0.070228584f,
		-0.00089153741f,-0.070228823f,0.99753052f);

	SimdMatrix3x3 basisB;
	basisB.setValue(1.0000000f,4.4865553e-018f,-4.4410586e-017f,
		4.4865495e-018f,0.97979438f,0.20000751f,
		4.4410586e-017f,-0.20000751f,0.97979438f);

	tr[0].setBasis(basisA);
	tr[1].setBasis(basisB);



	SimdVector3 boxHalfExtentsA(0.2,4,4);
	SimdVector3 boxHalfExtentsB(6,6,6);

	BoxShape*	boxA = new BoxShape(boxHalfExtentsA);
/*	BU_Simplex1to4	boxB;
	boxB.AddVertex(SimdPoint3(-5,0,-5));
	boxB.AddVertex(SimdPoint3(5,0,-5));
	boxB.AddVertex(SimdPoint3(0,0,5));
	boxB.AddVertex(SimdPoint3(0,5,0));
*/

	BoxShape*	boxB = new BoxShape(boxHalfExtentsB);
	shapePtr[0] = boxA;
	shapePtr[1] = boxB;

	shapePtr[0]->SetMargin(0.01f);
	shapePtr[1]->SetMargin(0.01f);

	SimdTransform tr;
	tr.setIdentity();
}
Exemplo n.º 2
0
int main(int argc,char** argv)
{
    setCameraDistance(20.f);

    tr[0].setOrigin(SimdVector3(0.0013328250f,8.1363249f,7.0390840f));
    tr[1].setOrigin(SimdVector3(0.00000000f,9.1262732f,2.0343180f));

    //tr[0].setOrigin(SimdVector3(0,0,0));
    //tr[1].setOrigin(SimdVector3(0,10,0));

    SimdMatrix3x3 basisA;
    basisA.setValue(0.99999958f,0.00022980258f,0.00090992288f,
                    -0.00029313788f,0.99753088f,0.070228584f,
                    -0.00089153741f,-0.070228823f,0.99753052f);

    SimdMatrix3x3 basisB;
    basisB.setValue(1.0000000f,4.4865553e-018f,-4.4410586e-017f,
                    4.4865495e-018f,0.97979438f,0.20000751f,
                    4.4410586e-017f,-0.20000751f,0.97979438f);

    tr[0].setBasis(basisA);
    tr[1].setBasis(basisB);



    SimdVector3 boxHalfExtentsA(1.0000004768371582f,1.0000004768371582f,1.0000001192092896f);
    SimdVector3 boxHalfExtentsB(3.2836332321166992f,3.2836332321166992f,3.2836320400238037f);

    BoxShape	boxA(boxHalfExtentsA);
    BoxShape	boxB(boxHalfExtentsB);
    shapePtr[0] = &boxA;
    shapePtr[1] = &boxB;


    SimdTransform tr;
    tr.setIdentity();


    return glutmain(argc, argv,screenWidth,screenHeight,"Collision Demo");
}