Distance / Ray based Camera - No Rigid bodies
2 posters
Distance / Ray based Camera - No Rigid bodies
Hi all,
I've been searching for forums for some implementation of using a distance ray for the camera instead of a ridig body and found to following links:
Collision with object and object
Collision with custom methods for camera
, both of which seems to suit me very well. However... I can't seem to get the callback to fire? I created a sensor inside the templateLoading method with the distance method from link#2 as follows:
and lifted the same method from link#1 and put it in my template.mm (& .h) file:
, which doesn't seemed to be called.
My goal is to create my own gravity using a distance ray to all the objects instead of a rigid body. Since I'm only trying to implement "standard first person movement", I believe using rays will give the best performance, am I wrong?
Any help with this is much appreciated! Thanks!
I've been searching for forums for some implementation of using a distance ray for the camera instead of a ridig body and found to following links:
Collision with object and object
Collision with custom methods for camera
, both of which seems to suit me very well. However... I can't seem to get the callback to fire? I created a sensor inside the templateLoading method with the distance method from link#2 as follows:
- Code:
SIO2object *myplane = sio2ResourceGetObject( sio2->_SIO2resource, "object/Plane");
sio2CameraSensorInitDistance("Camera2Plane", myplane, 2.0f, mySIO2sensordistance);
and lifted the same method from link#1 and put it in my template.mm (& .h) file:
- Code:
void mySIO2sensordistance ( void *_ptr ,float _dist)
{
SIO2sensor *sender = (SIO2sensor *)_ptr;
if (sio2StringCmp(sender->name, "Camera2Plane"))
{
printf("Sensor target_dist!\n");
}
}
, which doesn't seemed to be called.
My goal is to create my own gravity using a distance ray to all the objects instead of a rigid body. Since I'm only trying to implement "standard first person movement", I believe using rays will give the best performance, am I wrong?
Any help with this is much appreciated! Thanks!
swebal- Posts : 5
Join date : 2009-10-08
Re: Distance / Ray based Camera - No Rigid bodies
Actually, the method I lifted (sensor method) uses a rigid body, which is "bad" I guess. How would I create a "normal" ray (pointing down -Z) for the camera and detect the distance to any object hit?
I know, newbie question, but I'm not very familiar with c++, only c# and cocoa, so this is all quite new to me...
Thanks for any advise (aside from learning c++ before I post here again)!
I know, newbie question, but I'm not very familiar with c++, only c# and cocoa, so this is all quite new to me...
Thanks for any advise (aside from learning c++ before I post here again)!
swebal- Posts : 5
Join date : 2009-10-08
Re: Distance / Ray based Camera - No Rigid bodies
Don't mind me yet, I think I found something in tutorial9...
swebal- Posts : 5
Join date : 2009-10-08
Re: Distance / Ray based Camera - No Rigid bodies
I got it to work using the ray stuff from tutorial9...
I have to just say though, SIO2 RULES! I took a day studying Unity3D, trying to make the models from Blender render correctly, applying textures over and over again... SIO2 worked the first time, matching Blender OpenGL to the pixel. Simply amazing work!
I have to just say though, SIO2 RULES! I took a day studying Unity3D, trying to make the models from Blender render correctly, applying textures over and over again... SIO2 worked the first time, matching Blender OpenGL to the pixel. Simply amazing work!
swebal- Posts : 5
Join date : 2009-10-08
Re: Distance / Ray based Camera - No Rigid bodies
Yes, SIO2 is a great engine along with its amazing resources.swebal wrote:I got it to work using the ray stuff from tutorial9...
I have to just say though, SIO2 RULES! I took a day studying Unity3D, trying to make the models from Blender render correctly, applying textures over and over again... SIO2 worked the first time, matching Blender OpenGL to the pixel. Simply amazing work!
Please make sure to support this project when you can by purchasing an indie license (cheap) and / or Rom's meditation garden source code, as well as spreading the word...
As you know this is all great but as always all of this did not come free for the person (Rom) who gave us this great engine in the first place.
Cheers and welcome
--Franky
Francescu- Posts : 136
Join date : 2009-03-18
Similar topics
» Gun or cannon? Actual projectile or ray based?
» Constraints and soft bodies
» soft bodies properties question
» tutorial16 (soft bodies) runs very slowly
» Physics-based picking
» Constraints and soft bodies
» soft bodies properties question
» tutorial16 (soft bodies) runs very slowly
» Physics-based picking
Permissions in this forum:
You cannot reply to topics in this forum
|
|