more tweaks to breakable vent and barrel can now explode

This commit is contained in:
derek
2024-12-12 16:15:01 -06:00
parent 763b074148
commit 78dc14b84f
15 changed files with 297 additions and 104 deletions

View File

@@ -5,17 +5,10 @@ extends Node
# Check if a colliding body is aligned within a given angle of the object
# max_angle_diff --- note: set to 1 if angle won't be counted
# currently only works when objects are scaled (1,1,1)
func angle_velocity_aligned(source:Node,source_angle:Vector3,body:Node,max_angle_diff:Vector3):
func angle_velocity_aligned(source:Node, source_angle:Vector3, body:Node, max_angle_diff:Vector3):
var obj_direction = source.basis * source_angle
print("SOURCE BASIS ",source.basis)
var player_direction = body.velocity.normalized()
var diff = abs(abs(obj_direction) - abs(player_direction))
print("------------------------------------------------------------")
print("OBJ DIRECTION: ",obj_direction)
print("PLAYER DIRECTION: ", player_direction)
print("MAX ANGLE DIFF ",max_angle_diff)
print("DIFFERENCE: ", diff)
print("------------------------------------------------------------")
if diff.x <= max_angle_diff.x and diff.y <= max_angle_diff.y and diff.z <= max_angle_diff.z:
return true
else: