Jump to content
Lethal Raptor Games

Newton Commands

Recommended Posts

You can see in the file "Leadwerks\Include\Classes\Drivers\Physics\NewtonDynamics\NewtonDynamicsPhysicsDriver.h", that the PhysicsDriver has a reference to the collisionWorld, which is a NewtonWorld pointer. You can get the current physics-driver from "_currentPhysicsDriver" but you need to cast it to a NewtonDynamicsPhysicsDriver, thus:

((NewtonDynamicsPhysicsDriver*)(_currentPhysicsDriver))->collisionWorld

should be the droid you're looking for. (I haven't tested this but I am fairly certain, this will work)

  • Thanks 1

Share this post


Link to post
Quote

((NewtonDynamicsPhysicsDriver*)(_currentPhysicsDriver))->collisionWorld

Thought I'd update this here too, the above code doesn't get the correct newton world.  The code below does;

NewtonWorld* GetNewtonWorld()
{
	auto _world = World::GetCurrent();
	auto _simulation = (NewtonDynamicsSimulation*)_world->simulation;
	return _simulation->newtonworld;
}

 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...