Debian Codegraph @

scene/3d/physics/joints/joint_3d.h

raw symbols SCIP
1 /**************************************************************************/
2 /* joint_3d.h */
3 /**************************************************************************/
4 /* This file is part of: */
5 /* GODOT ENGINE */
6 /* https://godotengine.org */
7 /**************************************************************************/
8 /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
9 /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
10 /* */
11 /* Permission is hereby granted, free of charge, to any person obtaining */
12 /* a copy of this software and associated documentation files (the */
13 /* "Software"), to deal in the Software without restriction, including */
14 /* without limitation the rights to use, copy, modify, merge, publish, */
15 /* distribute, sublicense, and/or sell copies of the Software, and to */
16 /* permit persons to whom the Software is furnished to do so, subject to */
17 /* the following conditions: */
18 /* */
19 /* The above copyright notice and this permission notice shall be */
20 /* included in all copies or substantial portions of the Software. */
21 /* */
22 /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
23 /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
24 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
25 /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
26 /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
27 /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
28 /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
29 /**************************************************************************/
30
31 #pragma once
32
33 #include "scene/3d/node_3d.h"
34 #include "scene/3d/physics/physics_body_3d.h"
35
36 class Joint3D : public Node3D {
37 GDCLASS(Joint3D, Node3D);
38
39 RID ba, bb;
40
41 RID joint;
42
43 NodePath a;
44 NodePath b;
45
46 int solver_priority = 1;
47 bool exclude_from_collision = true;
48 String warning;
49 bool configured = false;
50
51 protected:
52 void _disconnect_signals();
53 void _body_exit_tree();
54 void _update_joint(bool p_only_free = false);
55
56 void _notification(int p_what);
57
58 virtual void _configure_joint(RID p_joint, PhysicsBody3D *body_a, PhysicsBody3D *body_b) = 0;
59
60 static void _bind_methods();
61
62 _FORCE_INLINE_ bool is_configured() const { return configured; }
63
64 public:
65 virtual PackedStringArray get_configuration_warnings() const override;
66
67 void set_node_a(const NodePath &p_node_a);
68 NodePath get_node_a() const;
69
70 void set_node_b(const NodePath &p_node_b);
71 NodePath get_node_b() const;
72
73 void set_solver_priority(int p_priority);
74 int get_solver_priority() const;
75
76 void set_exclude_nodes_from_collision(bool p_enable);
77 bool get_exclude_nodes_from_collision() const;
78
79 RID get_rid() const { return joint; }
80 Joint3D();
81 ~Joint3D();
82 };