EntityMover
Posted: Tue May 08, 2012 7:45 pm
Hi, just a few questions trying to understand how this works
1) In my world space, the vast majority of my models use StaticMesh. There are a few models I want to move by setting their position manually (i.e. teleportation, as you call it) during gameplay, and for them, I chose to use a predefined cylinder mesh movingEntity with the EntityMover class. I'm not looking at the code right now, but I believe the call to place it is something like TargetPosition. A few questions on that:
a) Since a static mesh world matrix/position can be set manually anytime after initialization, is there a reason to use an EntityMover as opposed to StaticMesh?
b) On accident, I found that two cylinders defined in that method with the EXACT same position/scale/etc, it is very easy to get a NaN exception thrown within the cylinder code. Is there a reason for that?
c) When, using the CharacterController, I walk into these cylinders, and am obstructed - correct behaviour. However, it often happens that after I walk into them, a short while (.1 to .5 seconds later), I am "bumped" away from the cylinder I walked into - it is almost like I intersected into the model, or the model moved when I walked into it and then reset into place. Are these occuring? I do not experience this behaviour with static meshes.
2) This is no longer an issue, but is easily repeatable, if you're interested: if I manually change the orientation of the cylinder in the CharacterController body and then go to an area that does not have support underneath but where the model does not fall through (say, a very small gap between two objects with no support underneath, or hanging off an edge of a model), a NaN exception occurs in the cylinder update function. I fixed this by realizing there was no reason to change the orientation of a cylinder, but this is just FYI.
Thanks for the help and the fabulous product!
James
1) In my world space, the vast majority of my models use StaticMesh. There are a few models I want to move by setting their position manually (i.e. teleportation, as you call it) during gameplay, and for them, I chose to use a predefined cylinder mesh movingEntity with the EntityMover class. I'm not looking at the code right now, but I believe the call to place it is something like TargetPosition. A few questions on that:
a) Since a static mesh world matrix/position can be set manually anytime after initialization, is there a reason to use an EntityMover as opposed to StaticMesh?
b) On accident, I found that two cylinders defined in that method with the EXACT same position/scale/etc, it is very easy to get a NaN exception thrown within the cylinder code. Is there a reason for that?
c) When, using the CharacterController, I walk into these cylinders, and am obstructed - correct behaviour. However, it often happens that after I walk into them, a short while (.1 to .5 seconds later), I am "bumped" away from the cylinder I walked into - it is almost like I intersected into the model, or the model moved when I walked into it and then reset into place. Are these occuring? I do not experience this behaviour with static meshes.
2) This is no longer an issue, but is easily repeatable, if you're interested: if I manually change the orientation of the cylinder in the CharacterController body and then go to an area that does not have support underneath but where the model does not fall through (say, a very small gap between two objects with no support underneath, or hanging off an edge of a model), a NaN exception occurs in the cylinder update function. I fixed this by realizing there was no reason to change the orientation of a cylinder, but this is just FYI.
Thanks for the help and the fabulous product!
James