Skip to content
0.2.0-dev Download ZIP
64 lines ·3.5 KB Raw
1/**************************************************************************/
2/* physics_point_query_parameters_2d.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 "core/object/ref_counted.h"
34#include "servers/physics_2d/physics_server_2d_types.h"
35
36class PhysicsPointQueryParameters2D : public RefCounted {
37 GDCLASS(PhysicsPointQueryParameters2D, RefCounted);
38
39 PS2DT::PointParameters parameters;
40
41protected:
42 static void _bind_methods();
43
44public:
45 const PS2DT::PointParameters &get_parameters() const { return parameters; }
46
47 void set_position(const Vector2 &p_position) { parameters.position = p_position; }
48 const Vector2 &get_position() const { return parameters.position; }
49
50 void set_canvas_instance_id(ObjectID p_canvas_instance_id) { parameters.canvas_instance_id = p_canvas_instance_id; }
51 ObjectID get_canvas_instance_id() const { return parameters.canvas_instance_id; }
52
53 void set_collision_mask(uint32_t p_mask) { parameters.collision_mask = p_mask; }
54 uint32_t get_collision_mask() const { return parameters.collision_mask; }
55
56 void set_collide_with_bodies(bool p_enable) { parameters.collide_with_bodies = p_enable; }
57 bool is_collide_with_bodies_enabled() const { return parameters.collide_with_bodies; }
58
59 void set_collide_with_areas(bool p_enable) { parameters.collide_with_areas = p_enable; }
60 bool is_collide_with_areas_enabled() const { return parameters.collide_with_areas; }
61
62 void set_exclude(const TypedArray<RID> &p_exclude);
63 TypedArray<RID> get_exclude() const;
64};