コード例 #1
0
#ifndef DISABLE_COLLISION_ALGORITHMS

#include "CollisionObject.h"
#include "CollisionObjectWrapper.h"
#include "PersistentManifold.h"
#include "SphereBoxCollisionAlgorithm.h"

SphereBoxCollisionAlgorithm::CreateFunc::CreateFunc()
	: CollisionAlgorithmCreateFunc(new btSphereBoxCollisionAlgorithm::CreateFunc())
{
}

SphereBoxCollisionAlgorithm::SphereBoxCollisionAlgorithm(PersistentManifold^ mf, CollisionAlgorithmConstructionInfo^ ci,
	CollisionObjectWrapper^ body0Wrap, CollisionObjectWrapper^ body1Wrap, bool isSwapped)
	: ActivatingCollisionAlgorithm(new btSphereBoxCollisionAlgorithm((btPersistentManifold*)GetUnmanagedNullable(mf),
		*ci->_native, body0Wrap->_native, body1Wrap->_native, isSwapped))
{
}


#define Native static_cast<btSphereBoxCollisionAlgorithm*>(_native)

bool SphereBoxCollisionAlgorithm::GetSphereDistance(CollisionObjectWrapper^ boxObjWrap,
	Vector3% v3PointOnBox, Vector3% normal, btScalar% penetrationDepth, Vector3 v3SphereCenter,
	btScalar fRadius, btScalar maxContactDistance)
{
	btVector3* v3PointOnBoxTemp = ALIGNED_NEW(btVector3);
	btVector3* normalTemp = ALIGNED_NEW(btVector3);
	VECTOR3_DEF(v3SphereCenter);
	btScalar penetrationDepthTemp;
コード例 #2
0
#include "SimplexSolverInterface.h"
#ifndef DISABLE_DEBUGDRAW
#include "DebugDraw.h"
#endif

#define Native static_cast<btGjkPairDetector*>(_native)

GjkPairDetector::GjkPairDetector(btGjkPairDetector* native)
	: DiscreteCollisionDetectorInterface(native)
{
}

GjkPairDetector::GjkPairDetector(ConvexShape^ objectA, ConvexShape^ objectB, SimplexSolverInterface^ simplexSolver,
	ConvexPenetrationDepthSolver^ penetrationDepthSolver)
	: DiscreteCollisionDetectorInterface(ALIGNED_NEW(btGjkPairDetector) ((btConvexShape*)objectA->_native,
		(btConvexShape*)objectB->_native, simplexSolver->_native, GetUnmanagedNullable(penetrationDepthSolver)))
{
}

GjkPairDetector::GjkPairDetector(ConvexShape^ objectA, ConvexShape^ objectB, BroadphaseNativeType shapeTypeA,
	BroadphaseNativeType shapeTypeB, btScalar marginA, btScalar marginB, SimplexSolverInterface^ simplexSolver,
	ConvexPenetrationDepthSolver^ penetrationDepthSolver)
	: DiscreteCollisionDetectorInterface(ALIGNED_NEW(btGjkPairDetector) ((btConvexShape*)objectA->_native,
		(btConvexShape*)objectB->_native, (int)shapeTypeA, (int)shapeTypeB, marginA, marginB,
		simplexSolver->_native, GetUnmanagedNullable(penetrationDepthSolver)))
{
}

#ifndef DISABLE_DEBUGDRAW
void GjkPairDetector::GetClosestPointsNonVirtual(ClosestPointInput^ input, Result^ output,
	IDebugDraw^ debugDraw)
コード例 #3
0
#endif
#ifndef DISABLE_GIMPACT
#include "GImpactShape.h"
#endif

Serialize::WorldImporter::WorldImporter(DynamicsWorld^ world)
{
	_world = world;
	_allocatedRigidBodies = gcnew System::Collections::Generic::List<CollisionObject^>();
	_allocatedCollisionShapes = gcnew System::Collections::Generic::List<CollisionShape^>();
#ifndef DISABLE_CONSTRAINTS
	_allocatedConstraints = gcnew System::Collections::Generic::List<TypedConstraint^>();
#endif
	_objectNameMap = gcnew System::Collections::Generic::Dictionary<Object^, String^>();
	_nameBodyMap = gcnew System::Collections::Generic::Dictionary<String^, RigidBody^>();
	_native = new WorldImporterWrapper((btDynamicsWorld*)GetUnmanagedNullable(world), this);
}

Serialize::WorldImporter::WorldImporter()
{
	_native = new WorldImporterWrapper(0, this);
}

Serialize::WorldImporter::~WorldImporter()
{
	this->!WorldImporter();
}

Serialize::WorldImporter::!WorldImporter()
{
	if (this->IsDisposed)
コード例 #4
0
#ifndef DISABLE_CONSTRAINTS
#include "ConeTwistConstraint.h"
#include "GearConstraint.h"
#include "Generic6DofConstraint.h"
#include "HingeConstraint.h"
#include "Point2PointConstraint.h"
#include "SliderConstraint.h"
#include "TypedConstraint.h"
#endif
#ifndef DISABLE_GIMPACT
#include "GImpactShape.h"
#endif

Serialize::BulletXmlWorldImporter::BulletXmlWorldImporter(DynamicsWorld^ world)
{
	_importer = new BulletXmlWorldImporterWrapper((btDynamicsWorld*)GetUnmanagedNullable(world), this);
}

Serialize::BulletXmlWorldImporter::BulletXmlWorldImporter()
{
	_importer = new BulletXmlWorldImporterWrapper(0, this);
}

Serialize::BulletXmlWorldImporter::~BulletXmlWorldImporter()
{
	this->!BulletXmlWorldImporter();
}

Serialize::BulletXmlWorldImporter::!BulletXmlWorldImporter()
{
	if (this->IsDisposed)