From 098f16fe3192ef17e7c749a70ea0607a22ae55fa Mon Sep 17 00:00:00 2001 From: idb Date: Mon, 1 Dec 2008 00:49:36 +0000 Subject: Remove duplicated avatar height calculation in lsl functions. Use height calculation in Basic Physics and Physics of Simplicity so that avatars larger than the default walk with straight legs and shorter walk on the ground. --- .../Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Physics/BasicPhysicsPlugin') diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs index cacb9eb..6a27f46 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs @@ -152,7 +152,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin actor.Position.X = 255.9F; } - float height = _heightMap[(int)actor.Position.Y * Constants.RegionSize + (int)actor.Position.X] + 1.0f; + float height = _heightMap[(int)actor.Position.Y * Constants.RegionSize + (int)actor.Position.X] + actor.Size.Z; if (actor.Flying) { if (actor.Position.Z + (actor.Velocity.Z*timeStep) < @@ -210,15 +210,16 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin private PhysicsVector _position; private PhysicsVector _velocity; private PhysicsVector _acceleration; + private PhysicsVector _size; private PhysicsVector m_rotationalVelocity = PhysicsVector.Zero; private bool flying; private bool iscolliding; - public BasicActor() { _velocity = new PhysicsVector(); _position = new PhysicsVector(); _acceleration = new PhysicsVector(); + _size = new PhysicsVector(); } public override int PhysicsActorType @@ -315,8 +316,11 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin public override PhysicsVector Size { - get { return PhysicsVector.Zero; } - set { } + get { return _size; } + set { + _size = value; + _size.Z = _size.Z / 2.0f; + } } public override PrimitiveBaseShape Shape -- cgit v1.1