create a new ode character also with the new information

avinationmerge
UbitUmarov 2012-12-07 20:06:35 +00:00
parent b2f3516b68
commit 2ea0dc55d7
4 changed files with 26 additions and 5 deletions

View File

@ -3450,9 +3450,15 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 pVec = AbsolutePosition; Vector3 pVec = AbsolutePosition;
/*
PhysicsActor = scene.AddAvatar( PhysicsActor = scene.AddAvatar(
LocalId, Firstname + "." + Lastname, pVec, LocalId, Firstname + "." + Lastname, pVec,
new Vector3(0.45f, 0.6f, Appearance.AvatarHeight), isFlying); new Vector3(0.45f, 0.6f, Appearance.AvatarHeight), isFlying);
*/
PhysicsActor = scene.AddAvatar(
LocalId, Firstname + "." + Lastname, pVec,
Appearance.AvatarBoxSize,Appearance.AvatarFeetOffset, isFlying);
//PhysicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; //PhysicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients;
PhysicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; PhysicsActor.OnCollisionUpdate += PhysicsCollisionUpdate;

View File

@ -127,8 +127,10 @@ namespace OpenSim.Region.Physics.Manager
/// <param name="size"></param> /// <param name="size"></param>
/// <param name="isFlying"></param> /// <param name="isFlying"></param>
/// <returns></returns> /// <returns></returns>
public abstract PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying); public virtual PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying)
{
return null;
}
/// <summary> /// <summary>
/// Add an avatar /// Add an avatar
/// </summary> /// </summary>
@ -145,6 +147,18 @@ namespace OpenSim.Region.Physics.Manager
return ret; return ret;
} }
public virtual PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size,float feetOffset, bool isFlying)
{
return null;
}
public virtual PhysicsActor AddAvatar(uint localID,string avName, Vector3 position, Vector3 size, float feetOffset, bool isFlying)
{
PhysicsActor ret = AddAvatar(avName, position, size,feetOffset, isFlying);
if (ret != null) ret.LocalID = localID;
return ret;
}
/// <summary> /// <summary>
/// Remove an avatar. /// Remove an avatar.
/// </summary> /// </summary>

View File

@ -156,7 +156,7 @@ namespace OpenSim.Region.Physics.OdePlugin
public OdeCharacter(String avName, OdeScene parent_scene, Vector3 pos, Vector3 pSize, float density, float walk_divisor, float rundivisor) public OdeCharacter(String avName, OdeScene parent_scene, Vector3 pos, Vector3 pSize, float pfeetOffset, float density, float walk_divisor, float rundivisor)
{ {
m_uuid = UUID.Random(); m_uuid = UUID.Random();
@ -192,6 +192,7 @@ namespace OpenSim.Region.Physics.OdePlugin
if(m_size.Z <0.01f) if(m_size.Z <0.01f)
m_size.Z = 0.01f; m_size.Z = 0.01f;
m_feetOffset = pfeetOffset;
m_orientation = Quaternion.Identity; m_orientation = Quaternion.Identity;
m_density = density; m_density = density;

View File

@ -1388,13 +1388,13 @@ namespace OpenSim.Region.Physics.OdePlugin
#region Add/Remove Entities #region Add/Remove Entities
public override PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying) public override PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, float feetOffset, bool isFlying)
{ {
Vector3 pos; Vector3 pos;
pos.X = position.X; pos.X = position.X;
pos.Y = position.Y; pos.Y = position.Y;
pos.Z = position.Z; pos.Z = position.Z;
OdeCharacter newAv = new OdeCharacter(avName, this, pos, size, avDensity, avMovementDivisorWalk, avMovementDivisorRun); OdeCharacter newAv = new OdeCharacter(avName, this, pos, size, feetOffset, avDensity, avMovementDivisorWalk, avMovementDivisorRun);
newAv.Flying = isFlying; newAv.Flying = isFlying;
newAv.MinimumGroundFlightOffset = minimumGroundFlightOffset; newAv.MinimumGroundFlightOffset = minimumGroundFlightOffset;