Added raycast checks to item drop interactions, so items cannot be placed;
Outside of the ViewPoint of an Entity.
On surfaces with a normal angle > 10.
The reason for the surface normal angle check is previously you could place any item against a wall or in any small place you could click, and the item would react with physics bouncing off the object it was spawned into.
Set rotation of placed item to be facing direction of entity.
Items now seem to place neatly on the floor or on tables, previously items would LookAt the hand of player entity and also have the rotation of the hand when placed.
Added ViewPoint to Entity, to use as position reference to check if an Entity has line of sight with a position.
PR checklist
[x] The game builds properly without errors.
[x] No unrelated changes are present.
[x] No "trash" files are committed.
[x] Relevant code is documented.
Testing
Can be tested by attempting to place item
Networking checklist
[x] Works from host in host mode.
Changes
Modified existing Entity prefabs (Human, Ghost, EngineeringBorg) to have a child ViewPoint Gameobject.
Summary
The reason for the surface normal angle check is previously you could place any item against a wall or in any small place you could click, and the item would react with physics bouncing off the object it was spawned into.
Set rotation of placed item to be facing direction of entity. Items now seem to place neatly on the floor or on tables, previously items would LookAt the hand of player entity and also have the rotation of the hand when placed.
Added ViewPoint to Entity, to use as position reference to check if an Entity has line of sight with a position.
PR checklist
Testing
Can be tested by attempting to place item
Networking checklist
Changes