Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
PhysicsCinematicTrack.c
Go to the documentation of this file.
1[CinematicTrackAttribute(name:"Physics Track", description:"Track used for physics")]
3{
4 [Attribute("0 0 0")]
5 vector m_velocity;
6
7 [Attribute("0 0 0")]
8 vector m_angularVelocity;
9
11 void playImpulse()
12 {
13 if(m_GeneralEntity)
14 {
15 vector velOrig = m_GeneralEntity.GetPhysics().GetVelocity();
16 vector vel = {velOrig[0] + m_velocity[0], velOrig[1] + m_velocity[1], velOrig[2] + m_velocity[2]};
17 m_GeneralEntity.GetPhysics().SetVelocity(vel);
18 m_GeneralEntity.GetPhysics().SetAngularVelocity(m_angularVelocity);
19 }
20 }
21
22 void findEntity(World world)
23 {
24 // Find particle entity by using name of track
25 TStringArray strs = new TStringArray;
26 GetTrackName().Split("_", strs, true);
27
28 m_GeneralEntity = GenericEntity.Cast(world.FindEntityByName(strs.Get(0)));
29 }
30
31 private GenericEntity m_GeneralEntity;
32 private World globalWorld;
33
34 override void OnInit(World world)
35 {
36 // Find particle entity by using name of track
37 findEntity(world);
38 globalWorld = world;
39 }
40
41 override void OnApply(float time)
42 {
43 }
44}
void CinematicEventAttribute(string name="")
Definition attributes.c:18
Definition World.c:16
SCR_FieldOfViewSettings Attribute
array< string > TStringArray
Definition Types.c:385