A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by Julio Jerez » Wed Nov 14, 2012 1:35 pm
Oh my bug, it is fie now please sync and try again.
did you set the origin of your playe at the lower bottom?
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by Neo » Wed Nov 14, 2012 10:22 pm
Sure, now the front direction is ok. But unforturnately, I failed to find the way to change the origin in irrlicht...
-
Neo
-
- Posts: 127
- Joined: Fri May 11, 2012 12:29 pm
- Location: China,Sichuan
by Julio Jerez » Thu Nov 15, 2012 7:20 am
where is the origon in irrlitch model?
My impresion was that is was the lowere bottom.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by Neo » Thu Nov 15, 2012 12:42 pm
Julio Jerez wrote:where is the origon in irrlitch model?
My impresion was that is was the lowere bottom.
Somewhere near the center, Despite how you model it in the 3dmax.
-
Neo
-
- Posts: 127
- Joined: Fri May 11, 2012 12:29 pm
- Location: China,Sichuan
by Julio Jerez » Thu Nov 15, 2012 12:59 pm
did that changed? it use to be that the oriogin was at the lower botton.
It does not matter the engine supports that
I will add a function to the controller like SetOrigin(vector origin)
and that will solved it
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by Neo » Thu Nov 15, 2012 1:23 pm
I searched the irrlicht forum, found that in irrlicht, the origin can not be changed since loaded into engine..
But do something when modeling could change it, in fact , my player did stand on land in the 3ds max(the lower part is nearly 0),
but when it is loaded into engine everything changed, I have no idea about how does irr set the origine..
Anyway, thx Julio.
Well, How about controller collision problem? Can a player block a dynamic body now?
-
Neo
-
- Posts: 127
- Joined: Fri May 11, 2012 12:29 pm
- Location: China,Sichuan
by Julio Jerez » Thu Nov 15, 2012 1:29 pm
I will solve both those problem over the weekend.
The origin first because it is eassier
if the orgin of a model in irrlict is not agt the bottom then Irrlitch must have a function to ge that origin.
how were you setting the origin before, can you post the code fragment that you were using?
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by Neo » Thu Nov 15, 2012 1:49 pm
irr set the origin automatically
All I have to do is use the getMesh() interface
somthing like:
- Code: Select all
irrMesh* mesh=videoDriver->getMesh(filename);
IrrSceneNode node*=SceneManager->addSceneNoe(Mesh);
There's no function for me to set or get the origin..Or maybe I can ask them on the irr forum..
-
Neo
-
- Posts: 127
- Joined: Fri May 11, 2012 12:29 pm
- Location: China,Sichuan
by Julio Jerez » Thu Nov 15, 2012 2:35 pm
how do you get teh dimation of teh collision shape?
or is there away to get the boudning box.
when you were using core 200, whow me the code you were using to initalize teh playe controller.
In the code there must be the way to ge the offset matrix for the collision shape?
In any case do not worry, when I add the function set origin,
the you can call it and set the orign to be at the cente of the BBox, and the will be the same as if we with core 200.
I will add that tonight.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by Neo » Fri Nov 16, 2012 4:34 am
Yeah, there's a a way to get bounding box
just call
- Code: Select all
aabbox3d bbox=object->getTrasformedBoundingBox
Then it will return a object which contain the information of bounding box ,and you can then call the
- Code: Select all
bbox->getExtent();
It will return a vector which contains the dimension information.
And in the core 200, I use this vector to create newton collision shape.
-
Neo
-
- Posts: 127
- Joined: Fri May 11, 2012 12:29 pm
- Location: China,Sichuan
by Julio Jerez » Fri Nov 16, 2012 11:54 am
Ok now there is a function for offseting teh playe origin. teh default is still teh lower bottom bu you cna call that funtion to change the origin
here is teh example
- Code: Select all
// now make a simple player controller,
dMatrix playerAxis;
playerAxis[0] = dVector (0.0f, 1.0f, 0.0f, 0.0f); // the y axis is the character up vector
playerAxis[1] = dVector (1.0f, 0.0f, 0.0f, 0.0f); // the x axis is the character front direction
playerAxis[2] = playerAxis[0] * playerAxis[1];
playerAxis[3] = dVector (0.0f, 0.0f, 0.0f, 1.0f);
// make the player controller, this function makes a kinematic body
m_controller = manager->CreatePlayer(radius, radius * 0.5f, height, height * 0.33f, playerAxis);
// player by default have the origin at the the center of the lower bottom of the collision shape.
// you can change this by calling SetPlayerOrigin, for example if a player has it origin at the center of the AABB you can call
m_controller->SetPlayerOrigin (height * 0.5f);
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by FSA » Sat Nov 17, 2012 7:18 pm
Is it normal, that the player body doesnt collide with objects wich connect by joints? I have a door with a custom hinge joint and the player just walk trhough the door without affect them. Is this the same problem you're working on? Without the joint everything is working fine.
-

FSA
-
- Posts: 322
- Joined: Wed Dec 21, 2011 9:47 am
by Julio Jerez » Sat Nov 17, 2012 7:40 pm
I should collide with every object, that is probleby a bug but let me figure ou the dll bug first.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by FSA » Fri Jan 25, 2013 7:02 am
Hi. After a long time I'm back to PlayerController.
1. What is the different between BasicPlayerController and AdvancedPlayerController? I can only notice that the Scene is different.
2. The problem with the HingeJoint is still there. If I want to change to AdvancedPlayerController what must I cange?
Thank you.
-

FSA
-
- Posts: 322
- Joined: Wed Dec 21, 2011 9:47 am
by Julio Jerez » Fri Jan 25, 2013 8:11 am
the advance player controller and the basic are the same, but the advance use triggers to interact with object in the scene.
what si the problem with hinges?
-
Julio Jerez
- 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