C# 클래스 Nez.Collider

파일 보기 프로젝트 열기: prime31/Nez 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
collidesWithLayers int
isTrigger bool
physicsLayer int
shape Nez.PhysicsShapes.Shape
shouldColliderScaleAndRotateWithTransform bool

보호된 프로퍼티들

프로퍼티 타입 설명
_colliderRequiresAutoSizing bool
_isColliderRegistered bool
_isParentEntityAddedToScene bool
_localOffset Vector2

공개 메소드들

메소드 설명
clone ( ) : Component
collidesWith ( Collider collider, CollisionResult &result ) : bool

checks to see if this Collider collides with collider. If it does, true will be returned and result will be populated with collision data

collidesWith ( Collider collider, Vector2 motion, CollisionResult &result ) : bool

checks to see if this Collider with motion applied (delta movement vector) collides with collider. If it does, true will be returned and result will be populated with collision data.

collidesWithAny ( CollisionResult &result ) : bool

checks to see if this Collider collides with any other Colliders in the Scene. The first Collider it intersects will have its collision data returned in the CollisionResult.

collidesWithAny ( Vector2 &motion, CollisionResult &result ) : bool

checks to see if this Collider with motion applied (delta movement vector) collides with any collider. If it does, true will be returned and result will be populated with collision data. Motion will be set to the maximum distance the Collider can travel before colliding.

onAddedToEntity ( ) : void
onDisabled ( ) : void
onEnabled ( ) : void
onEntityTransformChanged ( Transform comp ) : void
onRemovedFromEntity ( ) : void
overlaps ( Collider other ) : bool

checks to see if this shape overlaps any other Colliders in the Physics system

registerColliderWithPhysicsSystem ( ) : void

the parent Entity will call this at various times (when added to a scene, enabled, etc)

setLocalOffset ( Vector2 offset ) : Collider

localOffset is added to entity.position to get the final position for the collider. This allows you to add multiple Colliders to an Entity and position them separately.

setShouldColliderScaleAndRotateWithTransform ( bool shouldColliderScaleAndRotateWithTransform ) : Collider

if set to true, the Collider will scale and rotate following the Transform it is attached to

unregisterColliderWithPhysicsSystem ( ) : void

the parent Entity will call this at various times (when removed from a scene, disabled, etc)

메소드 상세

clone() 공개 메소드

public clone ( ) : Component
리턴 Component

collidesWith() 공개 메소드

checks to see if this Collider collides with collider. If it does, true will be returned and result will be populated with collision data
public collidesWith ( Collider collider, CollisionResult &result ) : bool
collider Collider Collider.
result CollisionResult Result.
리턴 bool

collidesWith() 공개 메소드

checks to see if this Collider with motion applied (delta movement vector) collides with collider. If it does, true will be returned and result will be populated with collision data.
public collidesWith ( Collider collider, Vector2 motion, CollisionResult &result ) : bool
collider Collider Collider.
motion Vector2 Motion.
result CollisionResult Result.
리턴 bool

collidesWithAny() 공개 메소드

checks to see if this Collider collides with any other Colliders in the Scene. The first Collider it intersects will have its collision data returned in the CollisionResult.
public collidesWithAny ( CollisionResult &result ) : bool
result CollisionResult Result.
리턴 bool

collidesWithAny() 공개 메소드

checks to see if this Collider with motion applied (delta movement vector) collides with any collider. If it does, true will be returned and result will be populated with collision data. Motion will be set to the maximum distance the Collider can travel before colliding.
public collidesWithAny ( Vector2 &motion, CollisionResult &result ) : bool
motion Vector2 Motion.
result CollisionResult Result.
리턴 bool

onAddedToEntity() 공개 메소드

public onAddedToEntity ( ) : void
리턴 void

onDisabled() 공개 메소드

public onDisabled ( ) : void
리턴 void

onEnabled() 공개 메소드

public onEnabled ( ) : void
리턴 void

onEntityTransformChanged() 공개 메소드

public onEntityTransformChanged ( Transform comp ) : void
comp Transform
리턴 void

onRemovedFromEntity() 공개 메소드

public onRemovedFromEntity ( ) : void
리턴 void

overlaps() 공개 메소드

checks to see if this shape overlaps any other Colliders in the Physics system
public overlaps ( Collider other ) : bool
other Collider
리턴 bool

registerColliderWithPhysicsSystem() 공개 메소드

the parent Entity will call this at various times (when added to a scene, enabled, etc)
public registerColliderWithPhysicsSystem ( ) : void
리턴 void

setLocalOffset() 공개 메소드

localOffset is added to entity.position to get the final position for the collider. This allows you to add multiple Colliders to an Entity and position them separately.
public setLocalOffset ( Vector2 offset ) : Collider
offset Vector2 Offset.
리턴 Collider

setShouldColliderScaleAndRotateWithTransform() 공개 메소드

if set to true, the Collider will scale and rotate following the Transform it is attached to
public setShouldColliderScaleAndRotateWithTransform ( bool shouldColliderScaleAndRotateWithTransform ) : Collider
shouldColliderScaleAndRotateWithTransform bool If set to true should collider scale and rotate with transform.
리턴 Collider

unregisterColliderWithPhysicsSystem() 공개 메소드

the parent Entity will call this at various times (when removed from a scene, disabled, etc)
public unregisterColliderWithPhysicsSystem ( ) : void
리턴 void

프로퍼티 상세

_colliderRequiresAutoSizing 보호되어 있는 프로퍼티

protected bool _colliderRequiresAutoSizing
리턴 bool

_isColliderRegistered 보호되어 있는 프로퍼티

flag to keep track of if we registered ourself with the Physics system
protected bool _isColliderRegistered
리턴 bool

_isParentEntityAddedToScene 보호되어 있는 프로퍼티

flag to keep track of if our Entity was added to a Scene
protected bool _isParentEntityAddedToScene
리턴 bool

_localOffset 보호되어 있는 프로퍼티

protected Vector2 _localOffset
리턴 Vector2

collidesWithLayers 공개적으로 프로퍼티

layer mask of all the layers this Collider should collide with when Entity.move methods are used. defaults to all layers.
public int collidesWithLayers
리턴 int

isTrigger 공개적으로 프로퍼티

if this collider is a trigger it will not cause collisions but it will still trigger events
public bool isTrigger
리턴 bool

physicsLayer 공개적으로 프로퍼티

physicsLayer can be used as a filter when dealing with collisions. The Flags class has methods to assist with bitmasks.
public int physicsLayer
리턴 int

shape 공개적으로 프로퍼티

the underlying Shape of the Collider
public Shape,Nez.PhysicsShapes shape
리턴 Nez.PhysicsShapes.Shape

shouldColliderScaleAndRotateWithTransform 공개적으로 프로퍼티

if true, the Collider will scale and rotate following the Transform it is attached to
public bool shouldColliderScaleAndRotateWithTransform
리턴 bool