Problem using EntityMover
Posted: Wed Dec 12, 2012 8:17 pm
I am trying to make a game in which i generate an avatar of the user with the kinect and make it interact with balls that are thrown at the user
the problem is that some times the entities i use to represent the users intersect themselves and it throws an NAN exception, i have found that this can be resolved by using the EntityMover class my problem is that when i set the target position they dont move am i missing something?
any help will be much appreciated
this does work but it launches exceptions from time to time specially when i lose track of the user and all joints get squished
the problem is that some times the entities i use to represent the users intersect themselves and it throws an NAN exception, i have found that this can be resolved by using the EntityMover class my problem is that when i set the target position they dont move am i missing something?
any help will be much appreciated
Code: Select all
List<EntityMover> fJoints
private void UpdateJoints(Skeleton s)
{
var i = 0;
foreach (Joint _Joint in s.Joints)
{
fJoints[i].TargetPosition = _Joint.Position.ToVector3();
i++;
}
}
Code: Select all
List<EntityMover> fJoints
private void UpdateJoints(Skeleton s)
{
var i = 0;
foreach (Joint _Joint in s.Joints)
{
var position = _Joint.Position.ToVector3();
fJoints[i].Entity.WorldTransform = Matrix.CreateTranslation(position);
fJoints[i].Entity.PositionUpdateMode = PositionUpdateMode.Continuous;
i++;
}
}