About Store Forum Documentation Contact



Post Reply 
Flying character & world boudaries
Author Message
miro@3dea Offline
Member

Post: #1
Flying character & world boudaries
Hello there,

I want to have a flying character by default, so it is initialized with "flying" and "actor.gravity" controller props with true and false. Now:
1. how to disable possibility to fly out of world edges
2. how to detect elevation/altitude of character to avoid flying below the ground? - If flying is slow enough towards world ground, ground collision is detected and flying continues along the ground level, but if character is flying at greater speed directly towards the ground it flies trough it.

tnx&br
08-06-2012 02:04 PM
Find all posts by this user Quote this message in a reply
velocityx Offline
Member

Post: #2
RE: Flying character & world boudaries
for a radius of the world edges,you could use a sphere,cube with no textures/invisible with collision,so when the character goes to it he'll hit the invisible wall
08-07-2012 12:34 PM
Find all posts by this user Quote this message in a reply
miro@3dea Offline
Member

Post: #3
RE: Flying character & world boudaries
(08-07-2012 12:34 PM)velocityx Wrote:  for a radius of the world edges,you could use a sphere,cube with no textures/invisible with collision,so when the character goes to it he'll hit the invisible wall

tnx velocityx, I'll try that! I just solved the other issue with hmHeight() information..

@Esenthel: pity that hmHeight() returns 0 on failure because it can be valid value. My suggestion would be to return e.g. -(std::numeric_limits<float>::max())
08-07-2012 03:34 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Flying character & world boudaries
Ineisis uses 6 Actors made from planes (as a box) to limit the allowed positions
08-10-2012 02:17 PM
Find all posts by this user Quote this message in a reply
miro@3dea Offline
Member

Post: #5
RE: Flying character & world boudaries
I was going to use the suggested solution with actors, but I was thinking about the problem with the ground: is an actor (box) going to have same problem as the ground? If the character flies too fast is it going to fly through the actor as it flies through the ground?
I have not tested the actor solution yet because I've found similar solution as for "fly through ground" solution: to validate pos.y I am checking it against hmHeight() and for pos.x & pos.z I am checking hmMaterial() because it returns null pointer if no material (world) is below character.
This way no additional input is required for world boundaries.

tnx&br
miro@3dea
08-10-2012 04:57 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: Flying character & world boudaries
try enabling ccd (continuous collision detection) for character controllers
08-14-2012 02:48 PM
Find all posts by this user Quote this message in a reply
wARmAcH1n3 Offline
Member

Post: #7
RE: Flying character & world boudaries
(08-06-2012 02:04 PM)info@3dea.hr Wrote:  Hello there,

I want to have a flying character by default, so it is initialized with "flying" and "actor.gravity" controller props with true and false. Now:
1. how to disable possibility to fly out of world edges
2. how to detect elevation/altitude of character to avoid flying below the ground? - If flying is slow enough towards world ground, ground collision is detected and flying continues along the ground level, but if character is flying at greater speed directly towards the ground it flies trough it.

tnx&br
if you have a flying character like in the tutorials or Bloody Massacre, i have to give you a warning:
if you fly against a wall, you can see and shoot through the wall, see here too
http://www.esenthel.com/community/showth...p?tid=5322
08-14-2012 06:05 PM
Find all posts by this user Quote this message in a reply
Post Reply