메소드 | 설명 | |
---|---|---|
AddNoiseToKick ( |
this can be used to vary the accuracy of a player's kick. Just call it prior to kicking the ball using the ball's position and the ball target as parameters.
|
|
CalculateFuturePosition ( double time ) : |
Given a time this method returns the ball position at that time in the future
|
|
CalucateTimeToCoverDistance ( |
Given a force and a distance to cover given by two vectors, this method calculates how long it will take the ball to travel between the two points
|
|
Kick ( |
applys a force to the ball in the direction of heading. Truncates the new velocity to make sure it doesn't exceed the max allowable.
|
|
PlaceAtPosition ( |
positions the ball at the desired location and sets the ball's velocity to zero
|
|
Render ( |
||
SoccerBall ( |
||
TestCollisionWithWalls ( List |
Tests to see if the ball has collided with a ball and reflects the ball's velocity accordingly
|
|
Trap ( ) : void | ||
Update ( ) : void |
updates the ball physics, tests for any collisions and adjusts the ball's velocity accordingly
|
메소드 | 설명 | |
---|---|---|
RandomClamp ( ) : double |
returns a random double in the range -1 < n < 1
|
public static AddNoiseToKick ( |
||
BallPos | ||
BallTarget | ||
리턴 |
public CalculateFuturePosition ( double time ) : |
||
time | double | |
리턴 |
public CalucateTimeToCoverDistance ( |
||
A | ||
B | ||
force | double | |
리턴 | double |
public Kick ( |
||
direction | ||
force | double | |
리턴 | void |
public SoccerBall ( |
||
position | ||
ballSize | double | |
mass | double | |
pitchBoundary | List |
|
리턴 | System |
public TestCollisionWithWalls ( List |
||
walls | List |
|
리턴 | void |