MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Initialize

Method Initialize

Source/Engine/Level/Actors/Spline.cpp:571–587  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

569}
570
571void Spline::Initialize()
572{
573 // Base
574 Actor::Initialize();
575
576 auto& keyframes = Curve.GetKeyframes();
577 const int32 count = keyframes.Count();
578
579 // Update bounds
580 _localBounds = BoundingBox(count != 0 ? keyframes[0].Value.Translation : Vector3::Zero);
581 for (int32 i = 1; i < count; i++)
582 _localBounds.Merge(keyframes[i].Value.Translation);
583 Matrix world;
584 GetLocalToWorldMatrix(world);
585 BoundingBox::Transform(_localBounds, world, _box);
586 BoundingSphere::FromBox(_box, _sphere);
587}
588
589void Spline::Serialize(SerializeStream& stream, const void* otherObj)
590{

Callers

nothing calls this directly

Calls 6

InitializeFunction · 0.50
BoundingBoxClass · 0.50
TransformClass · 0.50
GetKeyframesMethod · 0.45
CountMethod · 0.45
MergeMethod · 0.45

Tested by

no test coverage detected