MCPcopy Create free account
hub / github.com/demoth/jake2 / putInFrontOfCreator

Method putInFrontOfCreator

game/src/main/java/jake2/game/GameSpawn.java:1072–1082  ·  view source on GitHub ↗
(SubgameEntity creator, SubgameEntity newThing)

Source from the content-addressed store, hash-verified

1070 }
1071
1072 private static void putInFrontOfCreator(SubgameEntity creator, SubgameEntity newThing) {
1073 float[] location = creator.s.origin;
1074 float[] offset = {0,0,0};
1075 float[] forward = { 0, 0, 0 };
1076 Math3D.AngleVectors(creator.s.angles, forward, null, null);
1077 Math3D.VectorNormalize(forward);
1078 Math3D.VectorScale(forward, 128, offset);
1079 Math3D.VectorAdd(location, offset, offset);
1080 newThing.s.origin = offset;
1081 newThing.s.angles[Defines.YAW] = creator.s.angles[Defines.YAW];
1082 }
1083
1084 /**
1085 * Makes sense only for point entities

Callers 2

SpawnNewEntityMethod · 0.95
createEntityMethod · 0.95

Calls 4

AngleVectorsMethod · 0.95
VectorNormalizeMethod · 0.95
VectorScaleMethod · 0.95
VectorAddMethod · 0.95

Tested by

no test coverage detected