2: 2009-08-13 (木) 17:12:57 iseki |
現: 2009-08-31 (月) 18:31:57 iseki |
| ** SIM Boundary [#obc15ec7] | | ** SIM Boundary [#obc15ec7] |
- | - OpenSim/Region/Physics/OdePlugin/OdePlugin.cs の Move() 関数の actor.UpdatePositionAndVelocity() のところを修正. | + | - OpenSim/Region/Physics/OdePlugin/OdePlugin.cs |
| + | - Simulate() 関数内の actor.UpdatePositionAndVelocity() へチェックコードを追加. |
| | | |
| if (actor != null) { | | if (actor != null) { |
| actor.UpdatePositionAndVelocity(); | | actor.UpdatePositionAndVelocity(); |
| + | |
| // by Fumi.Iseki for falling at SIM boundary | | // by Fumi.Iseki for falling at SIM boundary |
| d.Vector3 vec = d.BodyGetPosition(actor.Body); | | d.Vector3 vec = d.BodyGetPosition(actor.Body); |
| + | |
| if (vec.Y<=0.0f || vec.Y>=255.95f || vec.X<=0.0f || vec.X>=255.95f) { | | if (vec.Y<=0.0f || vec.Y>=255.95f || vec.X<=0.0f || vec.X>=255.95f) { |
| if (vec.Y<=0.0f) vec.Y = 0.1f; | | if (vec.Y<=0.0f) vec.Y = 0.1f; |
| if (vec.X<=0.0f) vec.X = 0.1f; | | if (vec.X<=0.0f) vec.X = 0.1f; |
| else if (vec.X>255.95f) vec.X = 255.95f; | | else if (vec.X>255.95f) vec.X = 255.95f; |
- | | + | |
- | float height = _origheightmap[(int)vec.Y * Constants.RegionSize + (int)vec.X]; | + | float height = GetTerrainHeightAtXY(Vec.X, Vec.Y); |
| if (actor.Flying) { | | if (actor.Flying) { |
| if (vec.Z < height + 2) { | | if (vec.Z < height + 2) { |
| } | | } |
| } | | } |
| + | |
| actor.Position = new PhysicsVector(vec.X, vec.Y, vec.Z); | | actor.Position = new PhysicsVector(vec.X, vec.Y, vec.Z); |
| d.BodySetPosition(actor.Body, vec.X, vec.Y, vec.Z); | | d.BodySetPosition(actor.Body, vec.X, vec.Y, vec.Z); |
| } | | } |
| } | | } |