Hwo to change capsule height dynamically

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Hwo to change capsule height dynamically

Postby LukasBanana » Sun May 27, 2012 2:03 pm

Hi, I'm about to continue the work on the PlyerController again. via "NewtonCreateCapsule" I create the capsule collision and set a height for the player.
But when my player wants to crouch (or duck) I need to change the height dynamically. How can I do this?
My project: SoftPixel Engine
My forum: SoftPixel Forum
User avatar
LukasBanana
 
Posts: 35
Joined: Mon Jul 27, 2009 11:55 am
Location: Germany

Re: Hwo to change capsule height dynamically

Postby Julio Jerez » Sun May 27, 2012 2:31 pm

In core newton 2.00 teh only way is by using a transform modifier and it only apply to conve shapes
Stating with with core 300, the transform is part of the collision shape instance. and teh collsion insrtance hold teh geometry of teh shape
threfore all shape inheret a transfom, you have these functions to scale, translate or rotate any shape at will

Code: Select all
[code]void NewtonCollisionSetScale (const NewtonCollision* const collision, dFloat scaleX, dFloat scaleY, dFloat scaleZ);
void NewtonCollisionGetScale (const NewtonCollision* const collision, dFloat* const scaleX, dFloat* const scaleY, dFloat* const scaleZ);

void NewtonCollisionSetUserData (const NewtonCollision* const collision, void* const userData);
void* NewtonCollisionGetUserData (const NewtonCollision* const collision);
   
void NewtonCollisionSetUserID (const NewtonCollision* const collision, unsigned id);
unsigned NewtonCollisionGetUserID (const NewtonCollision* const collision);

void NewtonCollisionSetMatrix (const NewtonCollision* const collision, const dFloat* const matrix);
void NewtonCollisionGetMatrix (const NewtonCollision* const collision, dFloat* const matrix);[/code]
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Hwo to change capsule height dynamically

Postby LukasBanana » Sun May 27, 2012 2:47 pm

The functions you posted are only available in Newton 3.00? Ok I think I will finally update to 3.00 but this is still alpha and I need to compile by my self.
When will you upload a final (stable) release of 3.00?
My project: SoftPixel Engine
My forum: SoftPixel Forum
User avatar
LukasBanana
 
Posts: 35
Joined: Mon Jul 27, 2009 11:55 am
Location: Germany

Re: Hwo to change capsule height dynamically

Postby Julio Jerez » Sun May 27, 2012 3:30 pm

you can sinc to SVN, the demo is eassy to build.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron