Rally Rush
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
godot::Beam Class Reference

Area3D with a MeshInstance3D that resizes itself based on a from and to position and damages any objects that enter it. Requires a child collision shape and mesh instance. Both with Capsule primitive shapes. More...

#include <beam.hpp>

Inheritance diagram for godot::Beam:

Public Member Functions

virtual void _enter_tree () override
 Get child collision shape and mesh instance. Assumes both have a Capsule primitive shape. Creates copies collision and mesh shapes.
 
virtual void _process (double delta_time) override
 Destroy self after end time passes.
 
void body_entered (Node3D *node)
 Deal damage on whatever enters this node. Configure what to damage using collision mask.
 
void set_from_to (Vector3 from, Vector3 to)
 Transform self and shapes to stretch from -> to.
 
void set_end_time (float time_from_now)
 Pass in a duration and set the destroy timer for this object.
 

Private Member Functions

 GDCLASS (Beam, Area3D)
 

Static Private Member Functions

static void _bind_methods ()
 Required to be a valid godot class.
 

Private Attributes

MeshInstance3D * mesh_instance {nullptr}
 
Ref< CapsuleMesh > mesh {}
 
CollisionShape3D * collision_shape {nullptr}
 
Ref< CapsuleShape3D > shape {}
 
float end_time {0.f}
 

Detailed Description

Area3D with a MeshInstance3D that resizes itself based on a from and to position and damages any objects that enter it. Requires a child collision shape and mesh instance. Both with Capsule primitive shapes.

Member Function Documentation

◆ _bind_methods()

void godot::Beam::_bind_methods ( )
staticprivate

Required to be a valid godot class.

◆ _enter_tree()

void godot::Beam::_enter_tree ( )
overridevirtual

Get child collision shape and mesh instance. Assumes both have a Capsule primitive shape. Creates copies collision and mesh shapes.

◆ _process()

void godot::Beam::_process ( double  delta_time)
overridevirtual

Destroy self after end time passes.

◆ body_entered()

void godot::Beam::body_entered ( Node3D *  node)

Deal damage on whatever enters this node. Configure what to damage using collision mask.

◆ GDCLASS()

godot::Beam::GDCLASS ( Beam  ,
Area3D   
)
private

◆ set_end_time()

void godot::Beam::set_end_time ( float  time_from_now)

Pass in a duration and set the destroy timer for this object.

◆ set_from_to()

void godot::Beam::set_from_to ( Vector3  from,
Vector3  to 
)

Transform self and shapes to stretch from -> to.

Member Data Documentation

◆ collision_shape

CollisionShape3D* godot::Beam::collision_shape {nullptr}
private

◆ end_time

float godot::Beam::end_time {0.f}
private

◆ mesh

Ref<CapsuleMesh> godot::Beam::mesh {}
private

◆ mesh_instance

MeshInstance3D* godot::Beam::mesh_instance {nullptr}
private

◆ shape

Ref<CapsuleShape3D> godot::Beam::shape {}
private

The documentation for this class was generated from the following files: