class ObjectRotator extends Actor Placeable var float deltaAngle var V

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
class ObjectRotator extends Actor Placeable;
var() float deltaAngle;
var() Vector rotationPoint;
function Tick(float deltaTime)
{
local Vector newLoc;
local float a;
super.Tick(deltaTime);
newLoc = Location;
a = deltaAngle * deltaTime;
newLoc.X = rotationPoint.X + (newLoc.X - rotationPoint.X) * Cos(a) -
(newLoc.Y - rotationPoint.Y) * Sin(a);
newLoc.Y = rotationPoint.Y + (newLoc.Y - rotationPoint.Y) * Cos(a) +
(newLoc.X - rotationPoint.X) * Sin(a);
SetLocation(newLoc);
}
DefaultProperties
{
Begin Object Class=SpriteComponent Name=RotatingMesh
RotatingMesh = Texture2D'EditorResources.Ambientcreatures'
HiddenGame = false
End Object
Components.Add(RotatingMesh)
}