• R/O
  • SSH
  • HTTPS

nlgp1: Commit


Commit MetaInfo

Revision857 (tree)
Zeit2011-05-21 16:06:32
Autormassa_senohito

Log Message

Circleの衝突角度が取れるようになった
未検証である

Ändern Zusammenfassung

Diff

--- trunk/Nlgp1/Nlgp1/Sprites/Parameters/CircleSpriteShape.cs (revision 856)
+++ trunk/Nlgp1/Nlgp1/Sprites/Parameters/CircleSpriteShape.cs (revision 857)
@@ -3,7 +3,7 @@
33 using System.Linq;
44 using System.Text;
55 using Box2DX.Collision;
6-
6+using Nlgp1.Utilities;
77 namespace Nlgp1.Sprites.Parameters
88 {
99 class CircleSpriteShape:SpriteShape, ICircleSpriteShape
@@ -17,7 +17,9 @@
1717
1818 public override void PointRaise(Shape shape, Vector contactpos)
1919 {
20- this.contacts.Add(new CircleSpriteShapeContact(this, ((SpriteUserData)(shape.UserData)).SpriteShape, contactpos, float.NaN));
20+ Vector vec2=shape.GetBody().GetPosition();
21+ float angle = MathEx.Angle(vec2.X, vec2.Y, contactpos.X, contactpos.Y);
22+ this.contacts.Add(new CircleSpriteShapeContact(this, ((SpriteUserData)(shape.UserData)).SpriteShape, contactpos, angle));
2123 }
2224
2325 #region ICircleSpriteShape メンバ
Show on old repository browser