flagflag  If you want to see English page, please click "English" Button at Left.

SIM Boundary anchor.png

  • OpenSim/Region/Physics/OdePlugin/OdePlug​in.cs
  • Simulate() 関数内の actor.UpdatePositionAndVelocity() へチェックコードを追加.
if (actor != null) { 
   actor.UpdatePositionAndVelocity();

   // by Fumi.Iseki  for falling at SIM boundary
   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 = 0.1f; 
       else if (vec.Y>255.95f) vec.Y = 255.95f;
       if      (vec.X<=0.0f)   vec.X = 0.1f; 
       else if (vec.X>255.95f) vec.X = 255.95f;

       float height = GetTerrainHeightAtXY(Vec.X, Vec.Y);
       if (actor.Flying) {
           if (vec.Z  <  height + 2) {
               vec.Z = height + actor.Size.Z/2;
               actor.Velocity.Z = 0;
               actor.IsColliding = true; 
           }
       }
       else {
           if (vec.Z < height + actor.Size.Z/2) {
               vec.Z = height + actor.Size.Z/2;
               actor.Velocity.Z = 0;
               actor.IsColliding = true; 
               actor.CollidingGround = true; 
           }
       }

       actor.Position = new PhysicsVector(vec.X, vec.Y, vec.Z); 
       d.BodySetPosition(actor.Body, vec.X, vec.Y, vec.Z); 
   }       
}

トップ   凍結 差分 バックアップ 複製 名前変更 リロード   新規 ページ一覧 単語検索 最終更新   ヘルプ   最終更新のRSS 1.0 最終更新のRSS 2.0 最終更新のRSS Atom
Counter: 1740, today: 1, yesterday: 0
最終更新: 2009-08-31 (月) 18:31:57 (JST) (5350d) by iseki

サイト内 検索

ログイン

ユーザー名:

パスワード:


パスワード紛失
新規登録

サブ メニュー

ミニカレンダー

前月2024年 4月翌月
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
<今日>

オンライン状況

92 人のユーザが現在オンラインです。 (5 人のユーザが xpwiki を参照しています。)

登録ユーザ: 0
ゲスト: 92

もっと...

アクセスカウンタ

今日 : 9107910791079107
昨日 : 9457945794579457
総計 : 2333606423336064233360642333606423336064233360642333606423336064
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com