本文整理匯總了C#中BEPUutilities類的典型用法代碼示例。如果您正苦於以下問題:C# BEPUutilities類的具體用法?C# BEPUutilities怎麽用?C# BEPUutilities使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
BEPUutilities類屬於命名空間,在下文中一共展示了BEPUutilities類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Convert
//Vector2
public static Vector2 Convert(BEPUutilities.Vector2 bepuVector)
{
Vector2 toReturn;
toReturn.X = bepuVector.X;
toReturn.Y = bepuVector.Y;
return toReturn;
}
示例2: EntityModel
/// <summary>
/// Creates a new EntityModel.
/// </summary>
/// <param name="entity">Entity to attach the graphical representation to.</param>
/// <param name="model">Graphical representation to use for the entity.</param>
/// <param name="transform">Base transformation to apply to the model before moving to the entity.</param>
/// <param name="game">Game to which this component will belong.</param>
public EntityModel(Entity entity, Model model, BEPUutilities.Matrix transform, Game game, GameManager manager)
: base(game)
{
this.entity = entity;
this.model = model;
this.Transform = transform;
this._manager = manager;
//Collect any bone transformations in the model itself.
//The default cube model doesn't have any, but this allows the EntityModel to work with more complicated shapes.
boneTransforms = new Matrix[model.Bones.Count];
foreach (ModelMesh mesh in model.Meshes)
{
foreach (BasicEffect effect in mesh.Effects)
{
effect.EnableDefaultLighting();
}
}
}
示例3: Convert
public static Quaternion Convert(BEPUutilities.Quaternion q)
{
return new Quaternion(q.X, q.Y, q.Z, q.W);
}
示例4: SetOrientation
public override void SetOrientation(BEPUutilities.Quaternion quat)
{
Angles = quat;
}
示例5: HitSparks
private void HitSparks(BEPUutilities.Vector3 position)
{
Actor sparks = GameResources.ActorManager.SpawnTemplate("Sparks");
TransformComponent sparksXForm = sparks.GetComponent<TransformComponent>(ActorComponent.ComponentType.Transform);
sparksXForm.Translation = BepuConverter.Convert(position);
Sparks sparksBehavior = sparks.GetBehavior<Sparks>();
sparksBehavior.Emit();
}
示例6: GetVerticesAndIndicesFromModel
//TODO: This section could use some improvements. It's not very robust, especially on WP7. Remember the VertexBuffer.GetData bug on WP7.
/// <summary>
/// Gets an array of vertices and indices from the provided model.
/// </summary>
/// <param name="collisionModel">Model to use for the collision shape.</param>
/// <param name="vertices">Compiled set of vertices from the model.</param>
/// <param name="indices">Compiled set of indices from the model.</param>
public static void GetVerticesAndIndicesFromModel(Model collisionModel, out BEPUutilities.Vector3[] vertices, out int[] indices)
{
Vector3[] tempVertices;
GetVerticesAndIndicesFromModel(collisionModel, out tempVertices, out indices);
vertices = MathConverter.Convert(tempVertices);
}
示例7: SetOrientation
public abstract void SetOrientation(BEPUutilities.Quaternion quat);