Forces and vectors length

View previous topic View next topic Go down

Forces and vectors length

Post  _-MADMAN-_ on Thu Jun 18, 2009 9:12 am

OK, now I'm really mad. I doubled speed of my character - just for fun and test, and... Rays checking distance in front and sides hits colliders even if They are loooong way from character. I found, that problem is with camera direction vectors (x,y,z). Rays are cross products of camera direction and world Z axis - if camera moves, direction vector is longer, so rays too and here we go - I'm about 10m from rock and "BUM"... How can I create vector that will have same "transformation, direction" as (in this case) camera but it is own, independent length?

And the second thing, more complex. How can I avoid rigidbody bounces... like ship on the water surface for example. Is there any kind of collision margin? I do not think, that calculating tons of forces etc etc for real water simulation have sense for iPhone. I need object that smoothly slides and rock on non planar surfaces (waves).

I'm fighting with those two things from about three days I'm damn stuck (and tired Wink) If You can put me onto right direction (with good length Wink) I will be really greatfull!

Kind regards,
Mad

_-MADMAN-_

Posts : 52
Join date : 2009-04-23

View user profile

Back to top Go down

Re: Forces and vectors length

Post  ColorDelta on Thu Jun 18, 2009 10:07 am

1) How about a normalized pointer to the camera direction vector? Normalized vectors are always 1 unit long.

2) Maybe you can use the 'terrain clamping' code in this post?

ColorDelta

Posts : 16
Join date : 2009-03-25
Location : London, UK

View user profile

Back to top Go down

Re: Forces and vectors length

Post  _-MADMAN-_ on Thu Jun 18, 2009 10:23 am

1 - hmmm, I have not normalized up vector ;/ I really need to rest.

2- thanks, looks as good idea to reveal - I will try and give You feedback

_-MADMAN-_

Posts : 52
Join date : 2009-04-23

View user profile

Back to top Go down

Re: Forces and vectors length

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum