9 [
Attribute(
"", UIWidgets.ResourceNamePicker,
"Model",
"xob")]
11 [
Attribute(
"1", UIWidgets.ComboBox,
"Physics",
"", { ParamEnum(
"None",
"2"), ParamEnum(
"Static",
"1"), ParamEnum(
"Dynamic",
"0") } )]
19 SetFlags(EntityFlags.ACTIVE | EntityFlags.TRACEABLE | EntityFlags.VISIBLE,
false);
21 Resource resource = Resource.Load(Model);
22 VObject vobj = resource.GetResource().ToVObject();
27 Physics.CreateStatic(
this, 0xffffffff);
31 if(!Physics.CreateDynamic(
this, 1.0, 0xffffffff))
35 GetBounds(mins, maxs);
36 vector center = (mins + maxs) * 0.5;
37 vector size = maxs - mins;
39 ref PhysicsGeomDef geoms[] = {PhysicsGeomDef(
"", PhysicsGeom.CreateBox(size),
"material/default", 0xffffffff)};
40 Physics.CreateDynamicEx(
this, center, 1, geoms);
44 GetPhysics().SetMass(1.0);
45 GetPhysics().SetActive(ActiveState.ACTIVE);
53 GetPhysics().Destroy();