当前位置: 首页>>代码示例>>C#>>正文


C# PhysicsSimulator.Add方法代码示例

本文整理汇总了C#中PhysicsSimulator.Add方法的典型用法代码示例。如果您正苦于以下问题:C# PhysicsSimulator.Add方法的具体用法?C# PhysicsSimulator.Add怎么用?C# PhysicsSimulator.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhysicsSimulator的用法示例。


在下文中一共展示了PhysicsSimulator.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateAngleSpring

 public AngleSpring CreateAngleSpring(PhysicsSimulator physicsSimulator, Body body1, Body body2,
                                      float springConstant, float dampingConstant)
 {
     AngleSpring angleSpring = CreateAngleSpring(body1, body2, springConstant, dampingConstant);
     physicsSimulator.Add(angleSpring);
     return angleSpring;
 }
开发者ID:elefantstudio-se,项目名称:todesesser,代码行数:7,代码来源:SpringFactory.cs

示例2: CreateRevoluteJoint

 public RevoluteJoint CreateRevoluteJoint(PhysicsSimulator physicsSimulator, Body body1, Body body2,
                                          Vector2 initialAnchorPosition)
 {
     RevoluteJoint revoluteJoint = CreateRevoluteJoint(body1, body2, initialAnchorPosition);
     physicsSimulator.Add(revoluteJoint);
     return revoluteJoint;
 }
开发者ID:elefantstudio-se,项目名称:todesesser,代码行数:7,代码来源:JointFactory.cs

示例3: CreateFixedAngleSpring

 public FixedAngleSpring CreateFixedAngleSpring(PhysicsSimulator physicsSimulator, Body body,
                                                float springConstant, float dampningConstant)
 {
     FixedAngleSpring fixedAngleSpring = CreateFixedAngleSpring(body, springConstant, dampningConstant);
     physicsSimulator.Add(fixedAngleSpring);
     return fixedAngleSpring;
 }
开发者ID:ninetailsdev,项目名称:Quark,代码行数:7,代码来源:ControllerFactory.cs

示例4: CreatePinJoint

 public PinJoint CreatePinJoint(PhysicsSimulator physicsSimulator, Body body1, Vector2 anchor1, Body body2,
                                Vector2 anchor2)
 {
     PinJoint pinJoint = CreatePinJoint(body1, anchor1, body2, anchor2);
     physicsSimulator.Add(pinJoint);
     return pinJoint;
 }
开发者ID:elefantstudio-se,项目名称:todesesser,代码行数:7,代码来源:JointFactory.cs

示例5: CreateAngleJoint

 public AngleJoint CreateAngleJoint(PhysicsSimulator physicsSimulator, Body body1, Body body2, float softness,
                                    float biasFactor)
 {
     AngleJoint angleJoint = CreateAngleJoint(body1, body2, softness, biasFactor);
     physicsSimulator.Add(angleJoint);
     return angleJoint;
 }
开发者ID:ninetailsdev,项目名称:Quark,代码行数:7,代码来源:JointFactory.cs

示例6: CreateFixedLinearSpring

 public FixedLinearSpring CreateFixedLinearSpring(PhysicsSimulator physicsSimulator, Body body,
                                                  Vector2 bodyAttachPoint, Vector2 worldAttachPoint,
                                                  float springConstant, float dampingConstant)
 {
     FixedLinearSpring fixedSpring = CreateFixedLinearSpring(body, bodyAttachPoint, worldAttachPoint,
                                                             springConstant, dampingConstant);
     physicsSimulator.Add(fixedSpring);
     return fixedSpring;
 }
开发者ID:elefantstudio-se,项目名称:todesesser,代码行数:9,代码来源:SpringFactory.cs

示例7: CreateLinearSpring

 public LinearSpring CreateLinearSpring(PhysicsSimulator physicsSimulator, Body body1, Vector2 attachPoint1,
                                        Body body2, Vector2 attachPoint2, float springConstant,
                                        float dampingConstant)
 {
     LinearSpring linearSpring = CreateLinearSpring(body1, attachPoint1, body2, attachPoint2, springConstant,
                                                    dampingConstant);
     physicsSimulator.Add(linearSpring);
     return linearSpring;
 }
开发者ID:elefantstudio-se,项目名称:todesesser,代码行数:9,代码来源:SpringFactory.cs

示例8: CreateSliderJoint

 public SliderJoint CreateSliderJoint(PhysicsSimulator physicsSimulator, Body body1, Vector2 anchor1, Body body2,
                                      Vector2 anchor2, float min, float max)
 {
     SliderJoint sliderJoint = CreateSliderJoint(body1, anchor1, body2, anchor2, min, max);
     physicsSimulator.Add(sliderJoint);
     return sliderJoint;
 }
开发者ID:elefantstudio-se,项目名称:todesesser,代码行数:7,代码来源:JointFactory.cs

示例9: CreateCircleGeom

 /// <summary>
 /// Creates a circle geom.
 /// </summary>
 /// <param name="physicsSimulator">The physics simulator.</param>
 /// <param name="body">The body.</param>
 /// <param name="radius">The radius.</param>
 /// <param name="numberOfEdges">The number of edges.</param>
 /// <param name="offset">The offset.</param>
 /// <param name="rotationOffset">The rotation offset.</param>
 /// <param name="collisionGridSize">Size of the collision grid. - not used with SAT</param>
 /// <returns></returns>
 public Geom CreateCircleGeom(PhysicsSimulator physicsSimulator, Body body, float radius, int numberOfEdges,
                              Vector2 offset, float rotationOffset, float collisionGridSize)
 {
     Geom geometry = CreateCircleGeom(body, radius, numberOfEdges, offset, rotationOffset, collisionGridSize);
     physicsSimulator.Add(geometry);
     return geometry;
 }
开发者ID:elefantstudio-se,项目名称:todesesser,代码行数:18,代码来源:GeomFactory.cs

示例10: CreateBody

 public Body CreateBody(PhysicsSimulator physicsSimulator, Body body)
 {
     Body bodyClone = CreateBody(body);
     physicsSimulator.Add(bodyClone);
     return bodyClone;
 }
开发者ID:scotchfaster,项目名称:DaHooch_XnaComponentArchTest,代码行数:6,代码来源:BodyFactory.cs

示例11: CreateSATPolygonGeom

        /// <summary>
        /// Creates a polygon geometry.
        /// Use this if you use the SAT narrow phase collider. It will automatically decompose concave geometries using auto-divide.
        /// </summary>
        /// <param name="physicsSimulator">The physics simulator.</param>
        /// <param name="body">The body.</param>
        /// <param name="vertices">The vertices.</param>
        /// <param name="maxGeoms">The number of geometries to split the geometry into. It is needed to make SAT support concave polygons. The engine will try to reach the desired number of geometries.</param>
        /// <returns></returns>
        public List<Geom> CreateSATPolygonGeom(PhysicsSimulator physicsSimulator, Body body, Vertices vertices, int maxGeoms)
        {
            List<Geom> geometries = CreateSATPolygonGeom(body, vertices, maxGeoms);
            foreach (Geom geom in geometries)
            {
                physicsSimulator.Add(geom);
            }

            return geometries;
        }
开发者ID:elefantstudio-se,项目名称:todesesser,代码行数:19,代码来源:GeomFactory.cs

示例12: CreateAngleJoint

 public AngleJoint CreateAngleJoint(PhysicsSimulator physicsSimulator, Body body1, Body body2)
 {
     AngleJoint angleJoint = CreateAngleJoint(body1, body2);
     physicsSimulator.Add(angleJoint);
     return angleJoint;
 }
开发者ID:elefantstudio-se,项目名称:todesesser,代码行数:6,代码来源:JointFactory.cs

示例13: CreateGeoms

        /// <summary>
        /// Creates rectangular geoms that match the size of the bodies.
        /// Then adds the geometries to the given physics simulator.
        /// </summary>
        /// <param name="collisionCategory">The collision category of the geometries.</param>
        /// <param name="collidesWith">The collisioncategory the geometries should collide with..</param>
        /// <param name="physicsSimulator">The physics simulator.</param>
        public void CreateGeoms(CollisionCategory collisionCategory, CollisionCategory collidesWith, PhysicsSimulator physicsSimulator)
        {
            CreateGeoms(collisionCategory, collidesWith);

            foreach (Geom geom in _geoms)
            {
                physicsSimulator.Add(geom);
            }
        }
开发者ID:braahyan,项目名称:Platformer,代码行数:16,代码来源:Path.cs

示例14: AddToPhysicsSimulator

 /// <summary>
 /// Adds to physics simulator.
 /// </summary>
 /// <param name="physicsSimulator">The physics simulator.</param>
 public void AddToPhysicsSimulator(PhysicsSimulator physicsSimulator)
 {
     foreach (Body body in _bodies)
         physicsSimulator.Add(body);
     foreach (Geom geom in _geoms)
         physicsSimulator.Add(geom);
     foreach (Joint joint in _joints)
         physicsSimulator.Add(joint);
     foreach (Spring spring in _springs)
         physicsSimulator.Add(spring);
 }
开发者ID:braahyan,项目名称:Platformer,代码行数:15,代码来源:Path.cs

示例15: CreateGeom

 /// <summary>
 /// Creates a clone of a geometry.
 /// </summary>
 /// <param name="physicsSimulator">The physics simulator.</param>
 /// <param name="body">The body.</param>
 /// <param name="geometry">The geometry to clone.</param>
 /// <param name="offset">The offset.</param>
 /// <param name="rotationOffset">The rotation offset.</param>
 /// <returns></returns>
 public Geom CreateGeom(PhysicsSimulator physicsSimulator, Body body, Geom geometry, Vector2 offset,
                        float rotationOffset)
 {
     Geom geometryClone = CreateGeom(body, geometry, offset, rotationOffset);
     physicsSimulator.Add(geometryClone);
     return geometryClone;
 }
开发者ID:elefantstudio-se,项目名称:todesesser,代码行数:16,代码来源:GeomFactory.cs


注:本文中的PhysicsSimulator.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。