public PhysXCharacter(NxCharacter character) { _velocity = new PhysicsVector(); _position = new PhysicsVector(); _acceleration = new PhysicsVector(); _character = character; }
public OdeCharacter(OdeScene parent_scene, PhysicsVector pos) { _velocity = new PhysicsVector(); _position = pos; _acceleration = new PhysicsVector(); d.MassSetCapsule(out capsule_mass, 5.0f, 3, 0.5f, 2f); capsule_geom = d.CreateCapsule(OdeScene.space, 0.5f, 2f); this.BoundingCapsule = d.BodyCreate(OdeScene.world); d.BodySetMass(BoundingCapsule, ref capsule_mass); d.BodySetPosition(BoundingCapsule, pos.X, pos.Y, pos.Z); d.GeomSetBody(capsule_geom, BoundingCapsule); }
public override PhysicsActor AddAvatar(PhysicsVector position) { PhysicsVector pos = new PhysicsVector(); pos.X = position.X; pos.Y = position.Y; pos.Z = position.Z + 20; OdeCharacter newAv = new OdeCharacter(this, pos); this._characters.Add(newAv); return newAv; }
public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size) { Vec3 pos = new Vec3(); pos.X = position.X; pos.Y = position.Y; pos.Z = position.Z; Vec3 siz = new Vec3(); siz.X = size.X; siz.Y = size.Y; siz.Z = size.Z; PhysXPrim act = new PhysXPrim( scene.AddNewBox(pos, siz)); _prims.Add(act); return act; }
public abstract PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size);
public override void AddForce(PhysicsVector force) { }
public override void SetMomentum(PhysicsVector momentum) { }
public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size) { OpenSim.Framework.Console.MainConsole.Instance.WriteLine("NullPhysicsScene : AddPrim({0},{1})", position, size); return PhysicsActor.Null; }
public BasicActor() { _velocity = new PhysicsVector(); _position = new PhysicsVector(); _acceleration = new PhysicsVector(); }
public void AddNewPrim(ObjectAddPacket addPacket, SimClient AgentClient) { try { OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: AddNewPrim() - Creating new prim"); Primitive prim = new Primitive(m_clientThreads, m_regionHandle, this); prim.CreateFromPacket(addPacket, AgentClient.AgentID, this._primCount); PhysicsVector pVec = new PhysicsVector(prim.Pos.X, prim.Pos.Y, prim.Pos.Z); PhysicsVector pSize = new PhysicsVector(0.255f, 0.255f, 0.255f); if (OpenSim.world.Avatar.PhysicsEngineFlying) { lock (this.LockPhysicsEngine) { prim.PhysActor = this.phyScene.AddPrim(pVec, pSize); } } this.Entities.Add(prim.uuid, prim); this._primCount++; } catch (Exception e) { OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: AddNewPrim() - Failed with exception " + e.ToString()); } }
public abstract void SetMomentum(PhysicsVector momentum);
public abstract PhysicsActor AddAvatar(PhysicsVector position);
public abstract void AddForce(PhysicsVector force);
public override void SetMomentum(PhysicsVector momentum) { return; }
public override void AddForce(PhysicsVector force) { return; }
public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size) { PhysicsVector pos = new PhysicsVector(); pos.X = position.X; pos.Y = position.Y; pos.Z = position.Z; PhysicsVector siz = new PhysicsVector(); siz.X = size.X; siz.Y = size.Y; siz.Z = size.Z; return new OdePrim(); }
public override PhysicsActor AddAvatar(PhysicsVector position) { BasicActor act = new BasicActor(); act.Position = position; _actors.Add(act); return act; }
public override PhysicsActor AddAvatar(PhysicsVector position) { OpenSim.Framework.Console.MainConsole.Instance.WriteLine("NullPhysicsScene : AddAvatar({0})", position); return(PhysicsActor.Null); }
public override PhysicsActor AddAvatar(PhysicsVector position) { OpenSim.Framework.Console.MainConsole.Instance.WriteLine("NullPhysicsScene : AddAvatar({0})", position); return PhysicsActor.Null; }
public void AddViewerAgent(SimClient agentClient) { try { OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); Avatar newAvatar = new Avatar(agentClient, this, m_regionName, m_clientThreads, m_regionHandle, true, 20); OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Adding new avatar to world"); OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Starting RegionHandshake "); newAvatar.SendRegionHandshake(this); if (!agentClient.m_child) { PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z); lock (this.LockPhysicsEngine) { newAvatar.PhysActor = this.phyScene.AddAvatar(pVec); } } lock (Entities) { this.Entities.Add(agentClient.AgentID, newAvatar); } lock (Avatars) { this.Avatars.Add(agentClient.AgentID, newAvatar); } } catch (Exception e) { OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: AddViewerAgent() - Failed with exception " + e.ToString()); } }
public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size) { OpenSim.Framework.Console.MainConsole.Instance.WriteLine("NullPhysicsScene : AddPrim({0},{1})", position, size); return(PhysicsActor.Null); }
public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size) { return null; }
public override void addForces() { lock (this.forcesList) { if (this.forcesList.Count > 0) { for (int i = 0; i < this.forcesList.Count; i++) { NewForce force = this.forcesList[i]; PhysicsVector phyVector = new PhysicsVector(force.X, force.Y, force.Z); lock (m_world.LockPhysicsEngine) { this._physActor.Velocity = phyVector; } this.updateflag = true; this.velocity = new LLVector3(force.X, force.Y, force.Z); //shouldn't really be doing this // but as we are setting the velocity (rather than using real forces) at the moment it is okay. } for (int i = 0; i < this.forcesList.Count; i++) { this.forcesList.RemoveAt(0); } } } }
public PhysXPrim(NxActor prim) { _velocity = new PhysicsVector(); _position = new PhysicsVector(); _acceleration = new PhysicsVector(); _prim = prim; }
public void SetAcceleration(PhysicsVector accel) { this._acceleration = accel; }
public override PhysicsActor AddAvatar(PhysicsVector position) { Vec3 pos = new Vec3(); pos.X = position.X; pos.Y = position.Y; pos.Z = position.Z; PhysXCharacter act = new PhysXCharacter( scene.AddCharacter(pos)); act.Position = position; _characters.Add(act); return act; }
public void Move(float timeStep) { PhysicsVector vec = new PhysicsVector(); vec.X = this._velocity.X * timeStep; vec.Y = this._velocity.Y * timeStep; if (flying) { vec.Z = (this._velocity.Z + 0.5f) * timeStep; } d.BodySetLinearVel(this.BoundingCapsule, vec.X, vec.Y, vec.Z); }
public OdePrim() { _velocity = new PhysicsVector(); _position = new PhysicsVector(); _acceleration = new PhysicsVector(); }