本文整理汇总了C#中AABB.LinkDependency方法的典型用法代码示例。如果您正苦于以下问题:C# AABB.LinkDependency方法的具体用法?C# AABB.LinkDependency怎么用?C# AABB.LinkDependency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AABB
的用法示例。
在下文中一共展示了AABB.LinkDependency方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ResolutionTestNode
public ResolutionTestNode(State stateref, string name)
: base(stateref, name)
{
Body = new Body(this, "Body");
Body.Bounds = new Vector2(70, 70);
_physics = new Physics(this, "_physics");
_physics.LinkDependency(Physics.DEPENDENCY_BODY, Body);
_physics.Mass = 10f;
_physics.Restitution = 1f;
_physics.Drag = .95f;
Shape = new AABB(this, "AABB");
Shape.LinkDependency(AABB.DEPENDENCY_BODY, Body);
Collision = new Collision(this, "Collision");
Collision.LinkDependency(Collision.DEPENDENCY_SHAPE, Shape);
Collision.LinkDependency(Collision.DEPENDENCY_PHYSICS, _physics);
Collision.Initialize();
_imageRender = new ImageRender(this, "Image", Assets.Pixel);
_imageRender.LinkDependency(ImageRender.DEPENDENCY_BODY, Body);
_imageRender.Scale = new Vector2(70, 70);
_imageRender.Layer = .5f;
_textBody = new Body(this, "_textBody");
_textRender = new TextRender(this, "_textRender");
_textRender.LinkDependency(TextRender.DEPENDENCY_BODY, _textBody);
_textRender.Color = Color.White;
_textRender.Font = Assets.Font;
_textRender.Text = Name;
_textRender.Layer = 1f;
}
示例2: AabbNode
public AabbNode(State stateref, string name)
: base(stateref, name)
{
Body.Bounds = new Vector2(50 + RandomHelper.GetFloat(0, 30), 50 + RandomHelper.GetFloat(0, 30));
Shape = new AABB(this, "AABB");
Shape.LinkDependency(AABB.DEPENDENCY_BODY, Body);
Shape.LinkDependency(AABB.DEPENDENCY_COLLISION, Collision);
Collision.LinkDependency(Collision.DEPENDENCY_SHAPE, Shape);
ImageRender.Scale = new Vector2(Body.Width, Body.Height);
ImageRender.Layer = .5f;
TextRender.Color = Color.White;
TextRender.Font = Assets.Font;
TextRender.Text = Name;
TextRender.Layer = 1f;
}
示例3: AABBTester
public AABBTester(Node parent, string name, float width = 20, float height = 20)
: base(parent, name)
{
AABB = new AABB(this, "AABB");
AABB.LinkDependency(AABB.DEPENDENCY_BODY, Body);
AABB.LinkDependency(AABB.DEPENDENCY_COLLISION, Collision);
Body.Width = width;
Body.Height = height;
Render = new ShapeTypes.Rectangle(this, "Render", true);
Render.LinkDependency(ImageRender.DEPENDENCY_BODY, Body);
Body.Origin = new Vector2(.5f); //Half of a pixel since that is the size of the brush.
Collision.LinkDependency(Collision.DEPENDENCY_SHAPE, AABB);
}