Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_JointDummyHolderEntity.c
Go to the documentation of this file.
1
//------------------------------------------------------------------------------------------------
2
class
SCR_JointDummyHolderEntityClass
: GenericEntityClass
3
{
4
};
5
6
//------------------------------------------------------------------------------------------------
10
//------------------------------------------------------------------------------------------------
11
class
SCR_JointDummyHolderEntity:
GenericEntity
12
{
13
vector
m_FixedMat[4];
14
15
//------------------------------------------------------------------------------------------------
16
void
SetDummyTransform(
vector
mat[4])
17
{
18
m_FixedMat[0] = mat[0];
19
m_FixedMat[1] = mat[1];
20
m_FixedMat[2] = mat[2];
21
m_FixedMat[3] = mat[3];
22
SetTransform
(mat);
23
}
24
25
//------------------------------------------------------------------------------------------------
26
override
event
void
EOnSimulate(
IEntity
owner,
float
timeSlice)
27
{
28
Physics
physics = owner.
GetPhysics
();
29
if
(!physics)
30
return
;
31
32
SetTransform
(m_FixedMat);
33
physics.SetAngularVelocity(
vector
.Zero);
34
physics.SetVelocity(
vector
.Zero);
35
}
36
37
//------------------------------------------------------------------------------------------------
38
override
event
void
EOnInit(
IEntity
owner)
39
{
40
GetTransform
(m_FixedMat);
41
}
42
43
//------------------------------------------------------------------------------------------------
44
void
SCR_JointDummyHolderEntity(
IEntitySource
src,
IEntity
parent)
45
{
46
SetEventMask
(
EntityEvent
.INIT|
EntityEvent
.SIMULATE);
47
48
ref
PhysicsGeomDef
geoms[1];
49
autoptr
PhysicsGeomDef
geom =
new
PhysicsGeomDef
(
""
,
PhysicsGeom
.CreateSphere(0.1),
"material/default"
, EPhysicsLayerDefs.VehicleCast);
50
geoms[0] = geom;
51
52
// Note: If using static geometry, the joint gets reoriented!
53
//m_Physics = Physics.CreateStaticEx(this, geoms);
54
Physics
physics =
Physics
.CreateDynamicEx(
this
,
vector
.Zero, 999999, geoms);
55
physics.SetLinearFactor(
vector
.Zero);
56
physics.SetDamping(1000, 1000);
57
physics.SetAngularVelocity(
vector
.Zero);
58
physics.SetVelocity(
vector
.Zero);
59
}
60
61
//------------------------------------------------------------------------------------------------
62
void
~SCR_JointDummyHolderEntity()
63
{
64
}
65
};
66
GenericEntity
Definition
GenericEntity.c:16
IEntity::IEntity
void IEntity(IEntitySource src, IEntity parent)
protected script Constructor
IEntity::SetEventMask
proto external EntityEvent SetEventMask(EntityEvent e)
IEntity::GetPhysics
proto external Physics GetPhysics()
IEntity::SetTransform
proto external bool SetTransform(vector mat[4])
IEntity::GetTransform
proto external void GetTransform(out vector mat[])
IEntitySource
Definition
IEntitySource.c:13
PhysicsGeomDef
Definition
PhysicsGeomDef.c:16
PhysicsGeom
Definition
PhysicsGeom.c:16
Physics
Definition
Physics.c:22
SCR_JointDummyHolderEntityClass
Definition
SCR_JointDummyHolderEntity.c:3
vector
Definition
vector.c:13
EntityEvent
EntityEvent
Various entity events.
Definition
EntityEvent.c:14
scripts
Game
Entities
joints
SCR_JointDummyHolderEntity.c
Generated by
1.17.0