C# Class Nez.CircleCollider

Inheritance: Collider
Afficher le fichier Open project: prime31/Nez

Méthodes publiques

Méthode Description
CircleCollider ( ) : Microsoft.Xna.Framework

zero param constructor requires that a RenderableComponent be on the entity so that the collider can size itself when the entity is added to the scene.

CircleCollider ( float radius ) : Microsoft.Xna.Framework

creates a CircleCollider with radius. Note that when specifying a radius if using a RenderableComponent on the Entity as well you will need to set the origin to align the CircleCollider. For example, if the RenderableComponent has a 0,0 origin and a CircleCollider with a radius of 1.5f * renderable.width is created you can offset the origin by just setting the originNormalied to the center divided by the scaled size: entity.collider = new CircleCollider( moonTexture.Width * 1.5f ); entity.collider.originNormalized = Vector2Extension.halfVector() / 1.5f;

ToString ( ) : string
debugRender ( Graphics graphics ) : void
setRadius ( float radius ) : CircleCollider

Method Details

CircleCollider() public méthode

zero param constructor requires that a RenderableComponent be on the entity so that the collider can size itself when the entity is added to the scene.
public CircleCollider ( ) : Microsoft.Xna.Framework
Résultat Microsoft.Xna.Framework

CircleCollider() public méthode

creates a CircleCollider with radius. Note that when specifying a radius if using a RenderableComponent on the Entity as well you will need to set the origin to align the CircleCollider. For example, if the RenderableComponent has a 0,0 origin and a CircleCollider with a radius of 1.5f * renderable.width is created you can offset the origin by just setting the originNormalied to the center divided by the scaled size: entity.collider = new CircleCollider( moonTexture.Width * 1.5f ); entity.collider.originNormalized = Vector2Extension.halfVector() / 1.5f;
public CircleCollider ( float radius ) : Microsoft.Xna.Framework
radius float Radius.
Résultat Microsoft.Xna.Framework

ToString() public méthode

public ToString ( ) : string
Résultat string

debugRender() public méthode

public debugRender ( Graphics graphics ) : void
graphics Graphics
Résultat void

setRadius() public méthode

public setRadius ( float radius ) : CircleCollider
radius float
Résultat CircleCollider