• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# PhysicsSimulator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



PhysicsSimulator类属于命名空间,在下文中一共展示了PhysicsSimulator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: CreateAngleLimitJoint

 public AngleLimitJoint CreateAngleLimitJoint(PhysicsSimulator physicsSimulator, Body body1, Body body2,
                                              float min, float max)
 {
     AngleLimitJoint angleLimitJoint = CreateAngleLimitJoint(body1, body2, min, max);
     physicsSimulator.Add(angleLimitJoint);
     return angleLimitJoint;
 }
开发者ID:ninetailsdev,项目名称:Quark,代码行数:7,代码来源:JointFactory.cs


示例3: 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


示例4: 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


示例5: 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


示例6: 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


示例7: CreateChain

        /// <summary>
        /// Creates a chain from start to end points containing the specified number of links.
        /// </summary>
        /// <param name="physicsSimulator"><see cref="PhysicsSimulator"/> to add the chain to.</param>
        /// <param name="start">Starting point of the chain.</param>
        /// <param name="end">Ending point of the chain.</param>
        /// <param name="links">Number of links desired in the chain.</param>
        /// <param name="height">Height of each link.</param>
        /// <param name="mass">Mass of each link.</param>
        /// <param name="collisionGroup">Collision group for the chain.</param>
        /// <param name="type">The joint/spring type.</param>
        /// <returns>Path</returns>
        public Path CreateChain(PhysicsSimulator physicsSimulator, Vector2 start, Vector2 end, int links, float height,
                                float mass, int collisionGroup, LinkType type)
        {
            Path p = CreateChain(start, end, (Vector2.Distance(start, end) / links), height, mass, collisionGroup, type);

            p.AddToPhysicsSimulator(physicsSimulator);

            return p;
        }
开发者ID:amwaterston,项目名称:paradux,代码行数:21,代码来源:ComplexFactory.cs


示例8: SpatialHashCollider

 public SpatialHashCollider(PhysicsSimulator physicsSimulator, float cellSize, int hashCapacity)
 {
     _physicsSimulator = physicsSimulator;
     _hash = new Dictionary<long, List<Geom>>(hashCapacity);
     _keysToRemove = new List<long>(hashCapacity);
     _filter = new Dictionary<long, object>();
     _cellSize = cellSize;
     _cellSizeInv = 1 / cellSize;
 }
开发者ID:elefantstudio-se,项目名称:todesesser,代码行数:9,代码来源:SpatialHashCollider.cs


示例9: 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


示例10: 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


示例11: GravityController

        /// <summary>
        /// Initializes the GravityController.
        /// </summary>
        /// <param name="simulator">The physicsSimulator used by this controller.</param>
        /// <param name="points">The points that you want to generate gravity.</param>
        /// <param name="strength">the strength of gravity (the gravity strength when two bodies are on the same spot)</param>
        /// <param name="radius">the maximum distance that can be between 2 bodies before it will stop trying to apply gravity between them.</param>
        public GravityController(PhysicsSimulator simulator, List<Vector2> points, float strength, float radius)
        {
            _simulator = simulator;
            _strength = strength;

            if (_gravityType == GravityType.DistanceSquared)
                _strength *= 100;

            _radius = radius;
            _pointList = points;
        }
开发者ID:rpwjanzen,项目名称:2HourGame,代码行数:18,代码来源:GravityController.cs


示例12: GravityController

        /// <summary>
        /// Initializes the GravityController.
        /// </summary>
        /// <param name="simulator">The physicsSimulator used by this controller.</param>
        /// <param name="bodies">The bodies that you want to generate gravity.</param>
        /// <param name="points">The points that you want to generate gravity.</param>
        /// <param name="strength">the strength of gravity (the gravity strength when two bodies are on the same spot)</param>
        /// <param name="radius">the maximum distance that can be between 2 bodies before it will stop trying to apply gravity between them.</param>
        public GravityController(PhysicsSimulator simulator, List<Body> bodies, List<Vector2> points, float strength, float radius)
        {
            GravityType = GravityType.Linear;
            _simulator = simulator;
            _strength = strength;

            if (GravityType == GravityType.DistanceSquared)
                _strength *= 100;

            _radius = radius;
            PointList = points;
            BodyList = bodies;
        }
开发者ID:akipponn,项目名称:FriendsOnDesktop,代码行数:21,代码来源:GravityController.cs


示例13: InactivityController

 public InactivityController(PhysicsSimulator physicsSimulator)
 {
     _physicsSimulator = physicsSimulator;
 }
开发者ID:rpwjanzen,项目名称:2HourGame,代码行数:4,代码来源:InactivityController.cs


示例14: CreateTrack

        /// <summary>
        /// Creates a track.
        /// </summary>
        /// <param name="physicsSimulator">The physics simulator.</param>
        /// <param name="points">The points.</param>
        /// <param name="width">The width.</param>
        /// <param name="height">The height.</param>
        /// <param name="mass">The mass.</param>
        /// <param name="endless">if set to <c>true</c> [endless].</param>
        /// <param name="collisionGroup">Collision group for the chain.</param>
        /// <param name="type">The joint/spring type.</param>
        /// <returns></returns>
        public Path CreateTrack(PhysicsSimulator physicsSimulator, Vertices points, float width, float height,
                                float mass, bool endless, int collisionGroup, LinkType type)
        {
            Path path = CreateTrack(points, width, height, mass, endless, collisionGroup, type);

            path.AddToPhysicsSimulator(physicsSimulator);

            return path;
        }
开发者ID:rpwjanzen,项目名称:2HourGame,代码行数:21,代码来源:ComplexFactory.cs


示例15: CreateGravityController

 /// <summary>
 /// Creates a gravity controller and adds it to the physics simulator.
 /// </summary>
 /// <param name="simulator">the physicsSimulator used by this controller.</param>
 /// <param name="points">The points you want to generate gravity.</param>
 /// <param name="strength">the maximum strength of gravity (the gravity strength when two bodies are on the same spot)</param>
 /// <param name="radius">the maximum distance that can be between 2 bodies before it will stop trying to apply gravity between them.</param>
 /// <returns></returns>
 public GravityController CreateGravityController(PhysicsSimulator simulator, List<Vector2> points, float strength, float radius)
 {
     GravityController gravityController = new GravityController(simulator, points, strength, radius);
     simulator.Add(gravityController);
     return gravityController;
 }
开发者ID:rpwjanzen,项目名称:2HourGame,代码行数:14,代码来源:ComplexFactory.cs


示例16: CreateBody

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


示例17: CreateRectangleBody

 /// <summary>
 /// Creates a rectangle body.
 /// </summary>
 /// <param name="physicsSimulator">The physics simulator.</param>
 /// <param name="width">The width.</param>
 /// <param name="height">The height.</param>
 /// <param name="mass">The mass.</param>
 /// <returns></returns>
 public Body CreateRectangleBody(PhysicsSimulator physicsSimulator, float width, float height, float mass)
 {
     Body body = CreateRectangleBody(width, height, mass);
     physicsSimulator.Add(body);
     return body;
 }
开发者ID:scotchfaster,项目名称:DaHooch_XnaComponentArchTest,代码行数:14,代码来源:BodyFactory.cs


示例18: CreateEllipseBody

 /// <summary>
 /// Creates a ellipse body.
 /// </summary>
 /// <param name="physicsSimulator">The physics simulator.</param>
 /// <param name="xRadius">The width.</param>
 /// <param name="yRadius">The height.</param>
 /// <param name="mass">The mass.</param>
 /// <returns></returns>
 public Body CreateEllipseBody(PhysicsSimulator physicsSimulator, float xRadius, float yRadius, float mass)
 {
     Body body = CreateEllipseBody(xRadius, yRadius, mass);
     physicsSimulator.Add(body);
     return body;
 }
开发者ID:scotchfaster,项目名称:DaHooch_XnaComponentArchTest,代码行数:14,代码来源:BodyFactory.cs


示例19: CreateFixedRevoluteJoint

 public FixedRevoluteJoint CreateFixedRevoluteJoint(PhysicsSimulator physicsSimulator, Body body, Vector2 anchor)
 {
     FixedRevoluteJoint revoluteJoint = CreateFixedRevoluteJoint(body, anchor);
     physicsSimulator.Add(revoluteJoint);
     return revoluteJoint;
 }
开发者ID:elefantstudio-se,项目名称:todesesser,代码行数:6,代码来源:JointFactory.cs


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Picture类代码示例发布时间:2022-05-24
下一篇:
C# PhysicsScene类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap