Jump to content

Newton Commands


SpiderPig
 Share

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
Link to comment
Share on other sites

  • 4 weeks later...
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;
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

 Share

×
×
  • Create New...