本文整理汇总了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;
}
示例2: CreateRevoluteJoint
public RevoluteJoint CreateRevoluteJoint(PhysicsSimulator physicsSimulator, Body body1, Body body2,
Vector2 initialAnchorPosition)
{
RevoluteJoint revoluteJoint = CreateRevoluteJoint(body1, body2, initialAnchorPosition);
physicsSimulator.Add(revoluteJoint);
return revoluteJoint;
}
示例3: CreateFixedAngleSpring
public FixedAngleSpring CreateFixedAngleSpring(PhysicsSimulator physicsSimulator, Body body,
float springConstant, float dampningConstant)
{
FixedAngleSpring fixedAngleSpring = CreateFixedAngleSpring(body, springConstant, dampningConstant);
physicsSimulator.Add(fixedAngleSpring);
return fixedAngleSpring;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例10: CreateBody
public Body CreateBody(PhysicsSimulator physicsSimulator, Body body)
{
Body bodyClone = CreateBody(body);
physicsSimulator.Add(bodyClone);
return bodyClone;
}
示例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;
}
示例12: CreateAngleJoint
public AngleJoint CreateAngleJoint(PhysicsSimulator physicsSimulator, Body body1, Body body2)
{
AngleJoint angleJoint = CreateAngleJoint(body1, body2);
physicsSimulator.Add(angleJoint);
return angleJoint;
}
示例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);
}
}
示例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);
}
示例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;
}