Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CAreaGeneratorElement::PhysicalizeElement()
- {
- float mass = GetPropertyFloat(eProperty_Mass);
- if (mass < 0.01f)
- {
- SetPropertyFloat(eProperty_Mass, 10.0f);
- mass = 10.0f;
- }
- const char *modelPath = GetPropertyValue(eProperty_Model);
- if (strlen(modelPath) > 0)
- {
- auto &gameObject = *GetGameObject();
- const int geometrySlot = 0;
- LoadMesh(geometrySlot, modelPath);
- }
- SEntityPhysicalizeParams physicalizationParams;
- physicalizationParams.type = PE_RIGID;
- physicalizationParams.mass = mass;
- GetEntity()->Physicalize(physicalizationParams);
- GetEntity()->EnablePhysics(true);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement