• R/O
  • SSH
  • HTTPS

nlgp1: Commit


Commit MetaInfo

Revision722 (tree)
Zeit2011-02-21 09:29:01
Autormassa_senohito

Log Message

UserDataにIsRaycast追加
RigidBodyのRaycastはIsRaycastがfalseだとRayを投げないで、空の配列を返す
CevTestの改行位置変更

Ändern Zusammenfassung

Diff

--- trunk/Nlgp1/Nlgp1.Box2DX.Test/CevTest.cs (revision 721)
+++ trunk/Nlgp1/Nlgp1.Box2DX.Test/CevTest.cs (revision 722)
@@ -18,9 +18,11 @@
1818 {
1919 base.Persist(point);
2020 Shape s1 = point.Shape1, s2 = point.Shape2;
21- if (((myUserData)s1.GetBody().GetUserData()).name == "player" && ((float)(int)point.Position.Y == CalcfromShape.GetBottom(s2)))
21+ if (((myUserData)s1.GetBody().GetUserData()).name == "player" &&
22+ ((float)(int)point.Position.Y == CalcfromShape.GetBottom(s2)))
2223 playerhit(s1, s2);
23- if (((myUserData)s2.GetBody().GetUserData()).name == "player" && ((float)(int)point.Position.Y == CalcfromShape.GetBottom(s1)))
24+ if (((myUserData)s2.GetBody().GetUserData()).name == "player" &&
25+ ((float)(int)point.Position.Y == CalcfromShape.GetBottom(s1)))
2426 playerhit(s2, s1);
2527 }
2628
@@ -28,9 +30,11 @@
2830 {
2931 base.Add(point);
3032 Shape s1 = point.Shape1, s2 = point.Shape2;
31- if (((myUserData)s1.GetBody().GetUserData()).name == "player" && ((float)(int)point.Position.Y == CalcfromShape.GetBottom(s2)))
33+ if (((myUserData)s1.GetBody().GetUserData()).name == "player" &&
34+ ((float)(int)point.Position.Y == CalcfromShape.GetBottom(s2)))
3235 playerhit(s1, s2);
33- if (((myUserData)s2.GetBody().GetUserData()).name == "player" && ((float)(int)point.Position.Y == CalcfromShape.GetBottom(s1)))
36+ if (((myUserData)s2.GetBody().GetUserData()).name == "player" &&
37+ ((float)(int)point.Position.Y == CalcfromShape.GetBottom(s1)))
3438 playerhit(s2, s1);
3539 }
3640
--- trunk/Nlgp1/Nlgp1.Box2DX/RigidBody.cs (revision 721)
+++ trunk/Nlgp1/Nlgp1.Box2DX/RigidBody.cs (revision 722)
@@ -429,6 +429,8 @@
429429 /// <returns></returns>
430430 public Shape[] Raycast(Vec2 from,Vec2 to)
431431 {
432+ if (!this.UserData.IsRaycast) return new Shape[5];
433+
432434 Segment s;
433435 s.P1 = SelfBody.GetWorldPoint(from);
434436 s.P2 = SelfBody.GetWorldVector(to)+s.P1;
--- trunk/Nlgp1/Nlgp1.Box2DX/UserData.cs (revision 721)
+++ trunk/Nlgp1/Nlgp1.Box2DX/UserData.cs (revision 722)
@@ -18,7 +18,8 @@
1818 public int HP;
1919 public bool JointBroken;
2020 public RigidBody Body;
21-
21+ public bool IsRaycast=true;
22+
2223 public myUserData()
2324 {
2425
Show on old repository browser