CustomPlayerControllerFrame

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

CustomPlayerControllerFrame

Postby JulBaxter » Wed Mar 10, 2010 2:10 pm

in the tuto:

Code: Select all
dMatrix orientation;
orientation.m_front = dVector (0.0f, 1.0f, 0.0f, 0.0f);         // this is the player up direction
orientation.m_up    = dVector (1.0f, 0.0f, 0.0f, 0.0f);         // this is the player front direction
orientation.m_right = orientation.m_front * orientation.m_up;   // this is the player sideway direction
orientation.m_posit = dVector (0.0f, 0.0f, 0.0f, 1.0f);


Why player up direction is in orientation.m_front and player front direction in the orientation.m_up ?
JulBaxter
 
Posts: 23
Joined: Wed Mar 10, 2010 6:56 am

Re: CustomPlayerControllerFrame

Postby shybovycha » Fri Mar 12, 2010 11:48 am

Code: Select all
        // No we make and make a upright capsule for the collision mesh
   dMatrix orientation;
   orientation.m_front = dVector (0.0f, 1.0f, 0.0f, 0.0f);         // this is the player up direction
   orientation.m_up    = dVector (1.0f, 0.0f, 0.0f, 0.0f);         // this is the player front direction
   orientation.m_right = orientation.m_front * orientation.m_up;   // this is the player sideway direction
   orientation.m_posit = dVector (0.0f, 0.0f, 0.0f, 1.0f);


orientation is a [4;4] matrix. You can represent that rows as:

Code: Select all
   float **orientation = {{0, 1, 0, 0},
                                       {1, 0, 0, 0},
                                       {0, 0, -1, 0},
                                       {0, 0, 0, 1}};


No matter how you call rows =) But it's a little... important... for calculations =)
Image
User avatar
shybovycha
 
Posts: 52
Joined: Fri Oct 23, 2009 6:15 am
Location: Poland

Re: CustomPlayerControllerFrame

Postby Julio Jerez » Fri Mar 12, 2010 12:20 pm

Code: Select all
  float **orientation = {{0, 1, 0, 0},
                                       {1, 0, 0, 0},
                                       {0, 0, -1, 0},
                                       {0, 0, 0, 1}};

this is good, but there is a litl mistake.
It should be a pointer not a pointer to a pointer

Code: Select all
  float orientation[] = {{0, 1, 0, 0},
                         {1, 0, 0, 0},
                         {0, 0, -1, 0},
                         {0, 0, 0, 1}};


is better because it make a refrence instead of a pointer.
liek you said basically matrix is a 4x4 array of floats that make a transformation matrix.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: CustomPlayerControllerFrame

Postby JulBaxter » Fri Mar 12, 2010 1:00 pm

Thank you for reply.
JulBaxter
 
Posts: 23
Joined: Wed Mar 10, 2010 6:56 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron