Historique des modifications - Message

Message #11587

Sujet: Gestion du ragdoll [sous bullet] avec l'animation


Type Date Auteur Contenu
Création du message 11-04-2015 10:01:15 jonath313
Sais-tu comment on fait pour déplacer un objet avec bullet ?
J'ai fais une box et je voudrais la déplacer en fonction des évents :

Code c++ :

	ISceneNode *Node = smgr->addCubeSceneNode(1.0f);
	Node->setScale(TScale);
	///Node->setMaterialFlag(EMF_LIGHTING, 1);
	///Node->setMaterialFlag(EMF_NORMALIZE_NORMALS, true);
    Node->setMaterialTexture(0, driver->getTexture("media/rose.png"));
    Node ->setMaterialFlag(irr::video::EMF_LIGHTING, true);
    Node->setMaterialFlag(EMF_NORMALIZE_NORMALS, true);
	// Set the initial position of the object
	btTransform Transform;
	Transform.setIdentity();
	Transform.setOrigin(TPosition);

	btDefaultMotionState *MotionState = new btDefaultMotionState(Transform);

	// Create the shape
	btVector3 HalfExtents(TScale.X * 0.5f, TScale.Y * 0.5f, TScale.Z * 0.5f);
	btCollisionShape *Shape = new btBoxShape(HalfExtents);

	// Add mass
	btVector3 LocalInertia;
	Shape->calculateLocalInertia(TMass, LocalInertia);

	// Create the rigid body object
	btRigidBody *RigidBody = new btRigidBody(TMass, MotionState, Shape, LocalInertia);

	// Store a pointer to the irrlicht node so we can UPDATE it later
	RigidBody->setUserPointer((void *)(Node));

	// Add it to the world
	World->addRigidBody(RigidBody);
	Objects.push_back(RigidBody);

Cette box sera le cube de collision de mon personnage par exemple.

Merci smile

Retour

Options Liens officiels Caractéristiques Statistiques Communauté
Préférences cookies
Corrections
irrlicht
irrklang
irredit
irrxml
Propulsé par Django
xhtml 1.0
css 2.1
884 membres
1440 sujets
11337 messages
Dernier membre inscrit: Saidov17
194 invités en ligne
membre en ligne: -
RSS Feed