how do i place a guy 30 units above his position on.........
-
- Posts: 38
- Joined: Tue Aug 21, 2007 6:54 pm
- Contact:
how do i place a guy 30 units above his position on.........
how do i place my guy 30 units above his position on an octree node? I can load my mesh into an octreenode, and i can use ellipsiod collision detection on it, but when i try and make my guy go up steep hills, the guy sometimes catches parts of the floor and has an anoying pause during movement. I can think back to original collision progrmaming how id fix this, and it can be done by having the guy hover off of the floor a few units before you move the guy over with the next frame of movement. how can i get a ray collision point between my character and the floor in my octreenode?
i used the code from the demo example, but the mouse sprite pointer wouldnt move along with my character, and stayed at one position on the ground as i left the vicinity.
________
Angelina jolie pictures
i used the code from the demo example, but the mouse sprite pointer wouldnt move along with my character, and stayed at one position on the ground as i left the vicinity.
________
Angelina jolie pictures
Last edited by wREAKAILDRON on Tue Feb 22, 2011 6:52 am, edited 1 time in total.
Suppose you have found correct spot on terrain, at the end of each movement do:
Code: Select all
guy->setPosition( guy->getPosition() + vector3df(0,30,0) );
-
- Posts: 38
- Joined: Tue Aug 21, 2007 6:54 pm
- Contact:
i want to see the code that reveals the spot on the ground underneath me in the firstplace.
________
Bmw m12
________
Bmw m12
Last edited by wREAKAILDRON on Tue Feb 22, 2011 6:52 am, edited 1 time in total.
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
I think for the "pause" your ellipsoid is probably too small for the terrain. If your ellipsoid was wide (as wide as your character with it's legs stretched), it could move it the way you want... I'd suggest that you tweak your collision elipsoid some more.
Perhaps, you could move your ellipsoid (I use this to simulate a "crouch" on my FPS Camera) using
Also this could help you, check theses codes iin the SDK: (Also Example 7 as some collision intersection test in it)
Perhaps, you could move your ellipsoid (I use this to simulate a "crouch" on my FPS Camera) using
Code: Select all
virtual void setEllipsoidTranslation (const core::vector3df &translation)=0
Code: Select all
virtual bool getCollisionPoint (const core::line3d< f32 > &ray, ITriangleSelector *selector, core::vector3df &outCollisionPoint, core::triangle3df &outTriangle)=0
virtual core::vector3df getCollisionResultPosition (ITriangleSelector *selector, const core::vector3df &ellipsoidPosition, const core::vector3df &ellipsoidRadius, const core::vector3df &ellipsoidDirectionAndSpeed, core::triangle3df &triout, bool &outFalling, f32 slidingSpeed=0.0005f, const core::vector3df &gravityDirectionAndSpeed=core::vector3df(0.0f, 0.0f, 0.0f))=0
-
- Posts: 38
- Joined: Tue Aug 21, 2007 6:54 pm
- Contact:
i think you may have gave me what i need, but i want my guys to hover and glide and not walk on the ground, i want my guys to fly over the ground a bit.
________
NASH RAMBLER SPECIFICATIONS
________
NASH RAMBLER SPECIFICATIONS
Last edited by wREAKAILDRON on Tue Feb 22, 2011 6:52 am, edited 1 time in total.
Yes, so you add a vertical value to the ellipsoid translation and your done.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
-
- Posts: 38
- Joined: Tue Aug 21, 2007 6:54 pm
- Contact:
i finnaly got the triangle selector method from the castle demo to work, but when i place my guy 10 units above the intersection point, my guy wobbles horribly up and down at a sonic rate i think because of the gravity applied with the ellepisoid collision detection.
________
MARIJUANA VAPORIZERS
________
MARIJUANA VAPORIZERS
Last edited by wREAKAILDRON on Tue Feb 22, 2011 6:52 am, edited 1 time in total.
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
-
- Posts: 38
- Joined: Tue Aug 21, 2007 6:54 pm
- Contact:
i had the gravity down to 0,-1,0, and i got the worlbling, the only way i can make my guy hover over the ground, without the up and down jarring, at so many units above the ground is to loose the biult-in irrlicht gravity ( (0,0,0) gravity )
and i played with the translation a bit and that didnt help as well, i guess ill have to do my own gravity.
________
Drug Testing
and i played with the translation a bit and that didnt help as well, i guess ill have to do my own gravity.
________
Drug Testing
Last edited by wREAKAILDRON on Tue Feb 22, 2011 6:52 am, edited 1 time in total.
-
- Posts: 38
- Joined: Tue Aug 21, 2007 6:54 pm
- Contact:
how would i remove and set the gravity on an ISceneNodeAnimator node?
________
Alaska Medical Marijuana
________
Alaska Medical Marijuana
Last edited by wREAKAILDRON on Tue Feb 22, 2011 6:53 am, edited 1 time in total.
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
-
- Posts: 38
- Joined: Tue Aug 21, 2007 6:54 pm
- Contact:
i can make the guy hover nicely by not having any gravity on my ellipsoid collision detection, now i want to know how to add and take away the gravity of an ISceneNodeAnimator instance.
________
Hot Box Vaporizers
________
Hot Box Vaporizers