mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 02:36:00 +08:00
Implements llSetForce() and llGetForce(). These are experimental and the units may not match the Linden implementation.
This commit is contained in:
@@ -332,6 +332,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
|
||||
public override PhysicsVector Force
|
||||
{
|
||||
get { return PhysicsVector.Zero; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override PhysicsVector CenterOfMass
|
||||
|
||||
@@ -943,6 +943,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin
|
||||
public override PhysicsVector Force
|
||||
{
|
||||
get { return PhysicsVector.Zero; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override PhysicsVector CenterOfMass
|
||||
|
||||
@@ -173,7 +173,7 @@ namespace OpenSim.Region.Physics.Manager
|
||||
|
||||
public abstract PhysicsVector Position { get; set; }
|
||||
public abstract float Mass { get; }
|
||||
public abstract PhysicsVector Force { get; }
|
||||
public abstract PhysicsVector Force { get; set; }
|
||||
public abstract PhysicsVector GeometricCenter { get; }
|
||||
public abstract PhysicsVector CenterOfMass { get; }
|
||||
public abstract PhysicsVector Velocity { get; set; }
|
||||
@@ -277,6 +277,7 @@ namespace OpenSim.Region.Physics.Manager
|
||||
public override PhysicsVector Force
|
||||
{
|
||||
get { return PhysicsVector.Zero; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override PhysicsVector CenterOfMass
|
||||
|
||||
@@ -534,6 +534,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
public override PhysicsVector Force
|
||||
{
|
||||
get { return new PhysicsVector(_target_velocity.X, _target_velocity.Y, _target_velocity.Z); }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override PhysicsVector CenterOfMass
|
||||
|
||||
@@ -103,6 +103,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
private CollisionLocker ode;
|
||||
|
||||
private bool m_taintforce = false;
|
||||
private PhysicsVector m_force = new PhysicsVector(0.0f, 0.0f, 0.0f);
|
||||
private List<PhysicsVector> m_forcelist = new List<PhysicsVector>();
|
||||
|
||||
private IMesh _mesh;
|
||||
@@ -749,7 +750,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
changeshape(timestep);
|
||||
//
|
||||
|
||||
if (m_taintforce)
|
||||
if (m_taintforce || m_force != new PhysicsVector(0.0f, 0.0f, 0.0f))
|
||||
changeAddForce(timestep);
|
||||
|
||||
if (m_taintdisable)
|
||||
@@ -1751,7 +1752,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
//m_log.Info("[PHYSICS]: dequeing forcelist");
|
||||
if (IsPhysical)
|
||||
{
|
||||
PhysicsVector iforce = new PhysicsVector();
|
||||
//PhysicsVector iforce = new PhysicsVector();
|
||||
PhysicsVector iforce = m_force * 100.0f;
|
||||
for (int i = 0; i < m_forcelist.Count; i++)
|
||||
{
|
||||
iforce = iforce + (m_forcelist[i] * 100);
|
||||
@@ -1856,7 +1858,9 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
|
||||
public override PhysicsVector Force
|
||||
{
|
||||
get { return PhysicsVector.Zero; }
|
||||
//get { return PhysicsVector.Zero; }
|
||||
get { return m_force; }
|
||||
set { m_force = value; }
|
||||
}
|
||||
|
||||
public override PhysicsVector CenterOfMass
|
||||
|
||||
@@ -156,6 +156,7 @@ namespace OpenSim.Region.Physics.POSPlugin
|
||||
public override PhysicsVector Force
|
||||
{
|
||||
get { return PhysicsVector.Zero; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override PhysicsVector CenterOfMass
|
||||
|
||||
@@ -118,6 +118,7 @@ namespace OpenSim.Region.Physics.POSPlugin
|
||||
public override PhysicsVector Force
|
||||
{
|
||||
get { return PhysicsVector.Zero; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override PhysicsVector CenterOfMass
|
||||
|
||||
@@ -340,6 +340,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin
|
||||
public override PhysicsVector Force
|
||||
{
|
||||
get { return PhysicsVector.Zero; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override PhysicsVector CenterOfMass
|
||||
@@ -669,6 +670,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin
|
||||
public override PhysicsVector Force
|
||||
{
|
||||
get { return PhysicsVector.Zero; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override PhysicsVector CenterOfMass
|
||||
|
||||
Reference in New Issue
Block a user