From fdaa2920eb21fff3320a17e9239e04dfadecdb00 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 18 Apr 2015 14:38:54 -0300 Subject: Updated copyright year in all headers --- scene/3d/area.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scene/3d/area.h') diff --git a/scene/3d/area.h b/scene/3d/area.h index 40c6d24b5c..493c71c595 100644 --- a/scene/3d/area.h +++ b/scene/3d/area.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ -- cgit v1.2.3 From 473c7222f512488bfea3674358e15cac83d41ffb Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Thu, 19 Mar 2015 14:10:07 +0000 Subject: Calculate gravity based on distance from body to gravity point --- scene/3d/area.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scene/3d/area.h') diff --git a/scene/3d/area.h b/scene/3d/area.h index 493c71c595..fb853092f3 100644 --- a/scene/3d/area.h +++ b/scene/3d/area.h @@ -49,6 +49,7 @@ private: Vector3 gravity_vec; real_t gravity; bool gravity_is_point; + real_t gravity_distance_scale; real_t density; int priority; bool monitoring; @@ -98,6 +99,9 @@ public: void set_gravity_is_point(bool p_enabled); bool is_gravity_a_point() const; + void set_gravity_distance_scale(real_t p_scale); + real_t get_gravity_distance_scale() const; + void set_gravity_vector(const Vector3& p_vec); Vector3 get_gravity_vector() const; -- cgit v1.2.3 From 89300b70e7217feaf0be15cfe395763f555bbafa Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Fri, 12 Jun 2015 15:52:21 -0300 Subject: added ability for Area (3D) to detect other areas --- scene/3d/area.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'scene/3d/area.h') diff --git a/scene/3d/area.h b/scene/3d/area.h index fb853092f3..fa7500c47c 100644 --- a/scene/3d/area.h +++ b/scene/3d/area.h @@ -53,6 +53,7 @@ private: real_t density; int priority; bool monitoring; + bool monitorable; bool locked; @@ -84,6 +85,36 @@ private: }; Map body_map; + + + void _area_inout(int p_status,const RID& p_area, int p_instance, int p_area_shape,int p_self_shape); + + void _area_enter_tree(ObjectID p_id); + void _area_exit_tree(ObjectID p_id); + + struct AreaShapePair { + + int area_shape; + int self_shape; + bool operator<(const AreaShapePair& p_sp) const { + if (area_shape==p_sp.area_shape) + return self_shape < p_sp.self_shape; + else + return area_shape < p_sp.area_shape; + } + + AreaShapePair() {} + AreaShapePair(int p_bs, int p_as) { area_shape=p_bs; self_shape=p_as; } + }; + + struct AreaState { + + int rc; + bool in_tree; + VSet shapes; + }; + + Map area_map; void _clear_monitoring(); @@ -117,7 +148,14 @@ public: void set_enable_monitoring(bool p_enable); bool is_monitoring_enabled() const; + void set_monitorable(bool p_enable); + bool is_monitorable() const; + Array get_overlapping_bodies() const; + Array get_overlapping_areas() const; //function for script + + bool overlaps_area(Node* p_area) const; + bool overlaps_body(Node* p_body) const; Area(); -- cgit v1.2.3