SPhysxAndNodePair - where is it?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
prchakal
Posts: 58
Joined: Thu Sep 24, 2009 12:31 am

SPhysxAndNodePair - where is it?

Post by prchakal »

Hi ppl,

Im trying to use IrrPhysX but on examples found here, i need the class that implement it:

SPhysxAndNodePair

It is used on all examples but i dont find the file that have it, so, where is it?
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

It's in one of the common header files, it's probably in IrrPhysx/Examples/Common
Image Image Image
prchakal
Posts: 58
Joined: Thu Sep 24, 2009 12:31 am

Post by prchakal »

Code: Select all

// A struct to hold both the physical and visual representations of an object
struct SPhysxAndNodePair {
	
	SPhysxAndNodePair() {
		PhysxObject = NULL;
		SceneNode = NULL;
	}

	void updateTransformation() {
		if (PhysxObject->getType() == EOT_CLOTH) { // If it's a cloth we just need to update it (for tearing purposes)
			((IClothPhysxObject*)PhysxObject)->update();
		} else { // Otherwise we update its transformation
			core::vector3df vec;
			// Update the node's position to that of the physx object
			PhysxObject->getPosition(vec);
			SceneNode->setPosition(vec);
			// Update the node's rotation to that of the physx object
			PhysxObject->getRotation(vec);
			SceneNode->setRotation(vec);
		}
	}

	IPhysxObject* PhysxObject;
	scene::ISceneNode* SceneNode;

};
Thx, found at:
IrrPhysx-v0_2 for Irrlicht 1.5\examples\CommonCode\ShapeCreation.h
Post Reply