3 questions about movement and collisions. *solved*
3 questions about movement and collisions. *solved*
Hello.
I want to make a platformer and im having some trouble.
1. Is there a way to lock variable? For example i want the z variable to be constant 0 when i walk around. Something like vector3df(no change, no change, 0);
2. Is there a way to check if there is a wall in front of the player using the built in collision system? Like collision_check(x,y,z)
3. How do i adjust how far i can see? Because the scene is dissapearing within a certain distance.
Thank you.
-Ali
I want to make a platformer and im having some trouble.
1. Is there a way to lock variable? For example i want the z variable to be constant 0 when i walk around. Something like vector3df(no change, no change, 0);
2. Is there a way to check if there is a wall in front of the player using the built in collision system? Like collision_check(x,y,z)
3. How do i adjust how far i can see? Because the scene is dissapearing within a certain distance.
Thank you.
-Ali
Last edited by DarksideX on Mon Dec 15, 2008 4:27 am, edited 1 time in total.
-
- Posts: 199
- Joined: Tue Dec 09, 2008 2:55 am
-
- Posts: 368
- Joined: Tue Aug 21, 2007 1:43 am
- Location: The Middle of Nowhere
Thanks.I can answer #3 for you.
camera->setFarValue(value);
Il check out the second.#1. You'll need to set the z to 0 every frame I'm afraid.
#2. Should be possible, check out getCollisionPoint() and other methods of the collision system.
But how do i set the z to 0 every frame?
if i use vector3df(0,0,0) then i will be stuck on one spot? How can i set only ONE of the axes?
Thanks.
-Ali
How about:
Code: Select all
core::vector3df Pos = node->getPosition();
Pos.Z = 0;
node->setPosition( Pos );
Re: 3 questions about movement and collisions.
beside of all other posts:
you can also do it like this:DarksideX wrote:2. Is there a way to check if there is a wall in front of the player using the built in collision system? Like collision_check(x,y,z)
Code: Select all
// lock the Y position
node->setPosition(node->getPosition() * vector3df(1.0, 0.0, 1.0));
you can also make the nodes (scene) smaller...DarksideX wrote:3. How do i adjust how far i can see? Because the scene is dissapearing within a certain distance.
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Thanks alot guys.
I do not use fps camera. I simply set it to the players x and y-100, something like that.
First two questions solved now i just have to learn how to use getCollisionPoint(). Any hint or ideas what on how i use it? Like what parameters are needed and what they do? Or is there is there a page i can check on that?
Thanks-
-Ali
I do not use fps camera. I simply set it to the players x and y-100, something like that.
First two questions solved now i just have to learn how to use getCollisionPoint(). Any hint or ideas what on how i use it? Like what parameters are needed and what they do? Or is there is there a page i can check on that?
Thanks-
-Ali
I think the collision tutorial from the sdk is a good starting point and of course the API...DarksideX wrote:Or is there is there a page i can check on that?
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
-
- Posts: 368
- Joined: Tue Aug 21, 2007 1:43 am
- Location: The Middle of Nowhere
Your new best friend: http://irrlicht.sourceforge.net/docu/index.html
rogerborg wrote:Every time someone learns to use a debugger, an angel gets their wings.