4#include <godot_cpp/classes/area3d.hpp>
5#include <godot_cpp/classes/capsule_mesh.hpp>
6#include <godot_cpp/classes/capsule_shape3d.hpp>
7#include <godot_cpp/classes/collision_shape3d.hpp>
8#include <godot_cpp/classes/mesh.hpp>
9#include <godot_cpp/classes/mesh_instance3d.hpp>
10#include <godot_cpp/classes/shape3d.hpp>
14class Beam :
public Area3D {
22 virtual void _process(
double delta_time)
override;
Area3D with a MeshInstance3D that resizes itself based on a from and to position and damages any obje...
Definition beam.hpp:14
void set_from_to(Vector3 from, Vector3 to)
Transform self and shapes to stretch from -> to.
Definition beam.cpp:34
float end_time
Definition beam.hpp:34
static void _bind_methods()
Required to be a valid godot class.
Definition beam.cpp:6
Ref< CapsuleShape3D > shape
Definition beam.hpp:33
void set_end_time(float time_from_now)
Pass in a duration and set the destroy timer for this object.
Definition beam.cpp:47
virtual void _enter_tree() override
Get child collision shape and mesh instance. Assumes both have a Capsule primitive shape....
Definition beam.cpp:10
virtual void _process(double delta_time) override
Destroy self after end time passes.
Definition beam.cpp:24
CollisionShape3D * collision_shape
Definition beam.hpp:32
Ref< CapsuleMesh > mesh
Definition beam.hpp:31
void body_entered(Node3D *node)
Deal damage on whatever enters this node. Configure what to damage using collision mask.
Definition beam.cpp:30
MeshInstance3D * mesh_instance
Definition beam.hpp:30
Definition beacon_powerup.cpp:6