Page 1 of 1
Colliding first person camera
Posted: Sun Dec 04, 2011 9:37 pm
by RobSis
Hello.
I finally got bullet physics to work in my project, so now I want to make first person camera, that would collide with everything.
What object should I use to represent player? Cylinder? Box? Sphere?
Sphere rolls terribly long before it stops completely, box and cyllinders can flip over, and they don't work good when climbing stairs etc...
Also that object must be non-visible.
Do you have any ideas what I could do?
Thank you! btw: my first post here, so hi everybody!
Re: Colliding first person camera
Posted: Sun Dec 04, 2011 10:38 pm
by serengeor
Hi,
What object should I use to represent player? Cylinder? Box? Sphere?
You can use any shape you like/need.
Sphere rolls terribly long before it stops completely, box and cyllinders can flip over, and they don't work good when climbing stairs etc...
You can constraint the rotation of objects so they wouldn't flip over (tried with boxes and it works alright).
Also that object must be non-visible.
Every physics object is invisible unless you make it to be visible.
Re: Colliding first person camera
Posted: Mon Dec 05, 2011 6:29 am
by Cube_
I'd use a sphere (or cylinder, though preferably a sphere that is shaped like a watermelon

, better for walking in stairs and such) that is constrained.
Re: Colliding first person camera
Posted: Mon Dec 05, 2011 9:34 am
by RobSis
Thank you!
I will take look at the bullet's constraints.
Re: Colliding first person camera
Posted: Mon Dec 05, 2011 2:54 pm
by serengeor
RobSis wrote:Thank you!
I will take look at the bullet's constraints.
I didn't meant constraints, there's an actual function to set limits for every axis.
Might be this one(not sure about it though):
Code: Select all
void btRigidBody::setAngularFactor ( const btVector3 & angFac )
Re: Colliding first person camera
Posted: Mon Dec 05, 2011 3:47 pm
by RobSis
serengeor wrote:Might be this one(not sure about it though):
Yeah, I didn't know about that!
I tried to mess with it and I'm most comfortable with all rotations disabled - vector (0,0,0).
Cool stuff! Didn't tried the stairs though. Only steep platform which I had troubles to climb :)