C# 클래스 Nez.Splines.BezierSpline

houses a series of cubic bezier points and provides helper methods to access the bezier
파일 보기 프로젝트 열기: prime31/Nez 1 사용 예제들

공개 메소드들

메소드 설명
addCurve ( Vector2 start, Vector2 firstControlPoint, Vector2 secondControlPoint, Vector2 end ) : void

adds a curve to the bezier

getDirectionAtTime ( float t ) : Vector2

gets the direction (normalized first derivative) of the bezier at time t

getDrawingPoints ( int totalSegments ) : Microsoft.Xna.Framework.Vector2[]

breaks up the spline into totalSegments parts and returns all the points required to draw using lines

getPointAtTime ( float t ) : Vector2

gets the point on the bezier at time t

getVelocityAtTime ( float t ) : Vector2

gets the velocity (first derivative) of the bezier at time t

reset ( ) : void

resets the bezier removing all points

setControlPoint ( int index, Vector2 point ) : void

sets a control point taking into account if this is a shared point and adjusting appropriately if it is

비공개 메소드들

메소드 설명
pointIndexAtTime ( float &t ) : int

helper that gets the bezier point index at time t. t is modified in the process to be in the range of the curve segment.

메소드 상세

addCurve() 공개 메소드

adds a curve to the bezier
public addCurve ( Vector2 start, Vector2 firstControlPoint, Vector2 secondControlPoint, Vector2 end ) : void
start Microsoft.Xna.Framework.Vector2 Start.
firstControlPoint Microsoft.Xna.Framework.Vector2 First control point.
secondControlPoint Microsoft.Xna.Framework.Vector2 Second control point.
end Microsoft.Xna.Framework.Vector2
리턴 void

getDirectionAtTime() 공개 메소드

gets the direction (normalized first derivative) of the bezier at time t
public getDirectionAtTime ( float t ) : Vector2
t float T.
리턴 Microsoft.Xna.Framework.Vector2

getDrawingPoints() 공개 메소드

breaks up the spline into totalSegments parts and returns all the points required to draw using lines
public getDrawingPoints ( int totalSegments ) : Microsoft.Xna.Framework.Vector2[]
totalSegments int Total segments.
리턴 Microsoft.Xna.Framework.Vector2[]

getPointAtTime() 공개 메소드

gets the point on the bezier at time t
public getPointAtTime ( float t ) : Vector2
t float T.
리턴 Microsoft.Xna.Framework.Vector2

getVelocityAtTime() 공개 메소드

gets the velocity (first derivative) of the bezier at time t
public getVelocityAtTime ( float t ) : Vector2
t float T.
리턴 Microsoft.Xna.Framework.Vector2

reset() 공개 메소드

resets the bezier removing all points
public reset ( ) : void
리턴 void

setControlPoint() 공개 메소드

sets a control point taking into account if this is a shared point and adjusting appropriately if it is
public setControlPoint ( int index, Vector2 point ) : void
index int Index.
point Microsoft.Xna.Framework.Vector2 Point.
리턴 void