flagflag  
3: 2009-08-24 (Mon) 16:16:06 iseki source Cur: 2009-08-31 (Mon) 18:31:57 iseki source
Line 1: Line 1:
** SIM Boundary [#obc15ec7] ** SIM Boundary [#obc15ec7]
-- OpenSim/Region/Physics/OdePlugin/OdePlug​in.cs Simulate() 関数の actor.UpdatePositionAndVelocity() のところを修正.+- OpenSim/Region/Physics/OdePlugin/OdePlug​in.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;
Line 13: Line 14:
       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) {
Line 30: Line 31:
           }            }
       }        }
 + 
       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);
   }    }
 }  }


Front page   New List of Pages Search Recent changes   Help   RSS of recent changes (RSS 1.0) RSS of recent changes (RSS 2.0) RSS of recent changes (RSS Atom)

Site Search

Login

Username:

Password:


Lost Password?
Register now!!

Sub Menu

mini Calendar

Last MonthOct 2025Next Month
Su Mo Tu We Th Fr Sa
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Today

Access Counter

Today : 5607656076560765607656076
Yesterday : 6796167961679616796167961
Total : 3049363030493630304936303049363030493630304936303049363030493630
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com