MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / GetDesc

Method GetDesc

Source/Objects/object.cpp:278–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278void Object::GetDesc(EntityDescription &desc) const {
279 desc.AddEntityType(EDF_ENTITY_TYPE, GetType());
280 desc.AddString(EDF_NAME, name);
281 // Use loaded transforms if they haven't changed much, avoids spamming
282 // level xml diffs with changes from slight rounding errors
283 if (IsDifferentEnough(loaded_translation_, GetTranslation())) {
284 desc.AddVec3(EDF_TRANSLATION, GetTranslation());
285 } else {
286 desc.AddVec3(EDF_TRANSLATION, loaded_translation_);
287 }
288
289 if (IsDifferentEnough(loaded_scale_, GetScale())) {
290 desc.AddVec3(EDF_SCALE, GetScale());
291 } else {
292 desc.AddVec3(EDF_SCALE, loaded_scale_);
293 }
294
295 if (IsDifferentEnough(loaded_rotation_, GetRotation())) {
296 desc.AddQuaternion(EDF_ROTATION, GetRotation());
297 } else {
298 desc.AddQuaternion(EDF_ROTATION, loaded_rotation_);
299 }
300
301 if (!rotation_updated) {
302 desc.AddVec3(EDF_ROTATION_EULER, rotation_euler_);
303 } else {
304 desc.AddVec3(EDF_ROTATION_EULER, QuaternionToEuler(GetRotation()));
305 }
306
307 desc.AddInt(EDF_ID, GetID());
308 desc.AddScriptParams(EDF_SCRIPT_PARAMS, sp.GetParameterMap());
309 desc.AddIntVec(EDF_HOTSPOT_CONNECTED_TO, connected_to);
310 desc.AddIntVec(EDF_HOTSPOT_CONNECTED_FROM, connected_from);
311}
312
313void Object::ReceiveObjectMessage(OBJECT_MSG::Type type, ...) {
314 va_list args;

Callers

nothing calls this directly

Calls 13

GetTypeFunction · 0.85
IsDifferentEnoughFunction · 0.85
GetTranslationFunction · 0.85
GetScaleFunction · 0.85
GetRotationFunction · 0.85
QuaternionToEulerFunction · 0.85
AddEntityTypeMethod · 0.80
AddVec3Method · 0.80
AddQuaternionMethod · 0.80
AddIntMethod · 0.80
AddScriptParamsMethod · 0.80
AddIntVecMethod · 0.80

Tested by

no test coverage detected