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

Method SnapToGrid

Source/Engine/Core/Math/Vector3.cpp:337–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335
336template<>
337Float3 Float3::SnapToGrid(const Float3& pos, const Float3& gridSize)
338{
339 return Float3(Math::Ceil((pos.X - (gridSize.X * 0.5f)) / gridSize.X) * gridSize.X,
340 Math::Ceil((pos.Y - (gridSize.Y * 0.5f)) / gridSize.Y) * gridSize.Y,
341 Math::Ceil((pos.Z - (gridSize.Z * 0.5f)) / gridSize.Z) * gridSize.Z);
342}
343
344template<>
345Float3 Float3::SnapToGrid(const Float3& point, const Float3& gridSize, const Quaternion& gridOrientation, const Float3& gridOrigin, const Float3& offset)

Callers 1

Calls 5

Float3Class · 0.85
Double3Class · 0.85
Int3Class · 0.85
ConjugatedMethod · 0.80
CeilFunction · 0.70

Tested by

no test coverage detected