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

Method HandleCollision

Source/Objects/envobject.cpp:1814–1818  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1812 needs_set_inactive(false) {}
1813
1814void PlantComponent::HandleCollision(const vec3& position, const vec3& velocity) {
1815 vec3 impulse = cross(normalize(position), velocity) * 0.01f;
1816 ang_vel = impulse + ang_vel;
1817 plant_shake = min(1.0f, plant_shake + length(impulse) * 1.0f);
1818}
1819
1820mat4 PlantComponent::GetTransform(float scale) const {
1821 mat4 rotation;

Callers 1

ReceiveASVec3MessageMethod · 0.80

Calls 4

crossFunction · 0.50
normalizeFunction · 0.50
minFunction · 0.50
lengthFunction · 0.50

Tested by

no test coverage detected