Merge branch 'master' of https://github.com/godotengine/godot
|
@ -24,8 +24,8 @@ tools/editor/editor_icons.cpp
|
|||
make.bat
|
||||
log.txt
|
||||
|
||||
# Doxygen generated documentation
|
||||
doc/doxygen/*
|
||||
# Documentation generated by doxygen or from classes.xml
|
||||
doc/_build/
|
||||
|
||||
# Javascript specific
|
||||
*.bc
|
||||
|
@ -189,9 +189,6 @@ AutoTest.Net/
|
|||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# dumpdoc generated files
|
||||
doc/html/class_list
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
|
|
|
@ -1977,7 +1977,7 @@ void _Thread::_bind_methods() {
|
|||
ObjectTypeDB::bind_method(_MD("start:Error","instance","method","userdata","priority"),&_Thread::start,DEFVAL(Variant()),DEFVAL(PRIORITY_NORMAL));
|
||||
ObjectTypeDB::bind_method(_MD("get_id"),&_Thread::get_id);
|
||||
ObjectTypeDB::bind_method(_MD("is_active"),&_Thread::is_active);
|
||||
ObjectTypeDB::bind_method(_MD("wait_to_finish:var"),&_Thread::wait_to_finish);
|
||||
ObjectTypeDB::bind_method(_MD("wait_to_finish:Variant"),&_Thread::wait_to_finish);
|
||||
|
||||
BIND_CONSTANT( PRIORITY_LOW );
|
||||
BIND_CONSTANT( PRIORITY_NORMAL );
|
||||
|
|
|
@ -160,7 +160,20 @@ void Dictionary::_unref() const {
|
|||
}
|
||||
uint32_t Dictionary::hash() const {
|
||||
|
||||
return hash_djb2_one_64(make_uint64_t(_p));
|
||||
uint32_t h=hash_djb2_one_32(Variant::DICTIONARY);
|
||||
|
||||
List<Variant> keys;
|
||||
get_key_list(&keys);
|
||||
|
||||
for (List<Variant>::Element *E=keys.front();E;E=E->next()) {
|
||||
|
||||
h = hash_djb2_one_32( E->get().hash(), h);
|
||||
h = hash_djb2_one_32( operator[](E->get()).hash(), h);
|
||||
|
||||
}
|
||||
|
||||
|
||||
return h;
|
||||
}
|
||||
|
||||
Array Dictionary::keys() const {
|
||||
|
|
|
@ -309,7 +309,7 @@ Error Globals::setup(const String& p_path,const String & p_main_pack) {
|
|||
|
||||
print_line("has res dir: "+resource_path);
|
||||
if (!_load_resource_pack("res://data.pck"))
|
||||
_load_resource_pack("res://data.pcz");
|
||||
_load_resource_pack("res://data.zip");
|
||||
// make sure this is load from the resource path
|
||||
print_line("exists engine cfg? "+itos(FileAccess::exists("/engine.cfg")));
|
||||
if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) {
|
||||
|
@ -340,7 +340,7 @@ Error Globals::setup(const String& p_path,const String & p_main_pack) {
|
|||
//try to load settings in ascending through dirs shape!
|
||||
|
||||
//tries to open pack, but only first time
|
||||
if (first_time && (_load_resource_pack(current_dir+"/"+exec_name+".pck") || _load_resource_pack(current_dir+"/"+exec_name+".pcz") )) {
|
||||
if (first_time && (_load_resource_pack(current_dir+"/"+exec_name+".pck") || _load_resource_pack(current_dir+"/"+exec_name+".zip") )) {
|
||||
if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) {
|
||||
|
||||
_load_settings("res://override.cfg");
|
||||
|
@ -349,7 +349,7 @@ Error Globals::setup(const String& p_path,const String & p_main_pack) {
|
|||
|
||||
}
|
||||
break;
|
||||
} else if (first_time && (_load_resource_pack(current_dir+"/data.pck") || _load_resource_pack(current_dir+"/data.pcz") )) {
|
||||
} else if (first_time && (_load_resource_pack(current_dir+"/data.pck") || _load_resource_pack(current_dir+"/data.zip") )) {
|
||||
if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) {
|
||||
|
||||
_load_settings("res://override.cfg");
|
||||
|
|
|
@ -127,7 +127,7 @@ Error PacketPeer::_get_packet_error() const {
|
|||
void PacketPeer::_bind_methods() {
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("get_var"),&PacketPeer::_bnd_get_var);
|
||||
ObjectTypeDB::bind_method(_MD("put_var", "var:var"),&PacketPeer::put_var);
|
||||
ObjectTypeDB::bind_method(_MD("put_var", "var:Variant"),&PacketPeer::put_var);
|
||||
ObjectTypeDB::bind_method(_MD("get_packet"),&PacketPeer::_get_packet);
|
||||
ObjectTypeDB::bind_method(_MD("put_packet:Error", "buffer"),&PacketPeer::_put_packet);
|
||||
ObjectTypeDB::bind_method(_MD("get_packet_error:Error"),&PacketPeer::_get_packet_error);
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
#include "stream_peer.h"
|
||||
|
||||
#include "io/marshalls.h"
|
||||
|
||||
Error StreamPeer::_put_data(const DVector<uint8_t>& p_data) {
|
||||
|
||||
|
@ -115,6 +115,271 @@ Array StreamPeer::_get_partial_data(int p_bytes) {
|
|||
|
||||
}
|
||||
|
||||
void StreamPeer::set_big_endian(bool p_enable) {
|
||||
|
||||
big_endian=p_enable;
|
||||
}
|
||||
|
||||
bool StreamPeer::is_big_endian_enabled() const {
|
||||
|
||||
return big_endian;
|
||||
}
|
||||
|
||||
|
||||
void StreamPeer::put_u8(uint8_t p_val) {
|
||||
put_data((const uint8_t*)&p_val,1);
|
||||
|
||||
}
|
||||
|
||||
void StreamPeer::put_8(int8_t p_val){
|
||||
|
||||
put_data((const uint8_t*)&p_val,1);
|
||||
}
|
||||
void StreamPeer::put_u16(uint16_t p_val){
|
||||
|
||||
if (big_endian) {
|
||||
p_val=BSWAP16(p_val);
|
||||
}
|
||||
uint8_t buf[2];
|
||||
encode_uint16(p_val,buf);
|
||||
put_data(buf,2);
|
||||
|
||||
}
|
||||
void StreamPeer::put_16(int16_t p_val){
|
||||
|
||||
if (big_endian) {
|
||||
p_val=BSWAP16(p_val);
|
||||
}
|
||||
uint8_t buf[2];
|
||||
encode_uint16(p_val,buf);
|
||||
put_data(buf,2);
|
||||
|
||||
}
|
||||
void StreamPeer::put_u32(uint32_t p_val){
|
||||
|
||||
if (big_endian) {
|
||||
p_val=BSWAP32(p_val);
|
||||
}
|
||||
uint8_t buf[4];
|
||||
encode_uint32(p_val,buf);
|
||||
put_data(buf,4);
|
||||
|
||||
}
|
||||
void StreamPeer::put_32(int32_t p_val){
|
||||
|
||||
if (big_endian) {
|
||||
p_val=BSWAP32(p_val);
|
||||
}
|
||||
uint8_t buf[4];
|
||||
encode_uint32(p_val,buf);
|
||||
put_data(buf,4);
|
||||
|
||||
}
|
||||
void StreamPeer::put_u64(uint64_t p_val){
|
||||
|
||||
if (big_endian) {
|
||||
p_val=BSWAP64(p_val);
|
||||
}
|
||||
uint8_t buf[8];
|
||||
encode_uint64(p_val,buf);
|
||||
put_data(buf,8);
|
||||
|
||||
}
|
||||
void StreamPeer::put_64(int64_t p_val){
|
||||
|
||||
if (big_endian) {
|
||||
p_val=BSWAP64(p_val);
|
||||
}
|
||||
uint8_t buf[8];
|
||||
encode_uint64(p_val,buf);
|
||||
put_data(buf,8);
|
||||
|
||||
}
|
||||
void StreamPeer::put_float(float p_val){
|
||||
|
||||
uint8_t buf[4];
|
||||
|
||||
encode_float(p_val,buf);
|
||||
if (big_endian) {
|
||||
uint32_t *p32=(uint32_t *)buf;
|
||||
*p32=BSWAP32(*p32);
|
||||
}
|
||||
|
||||
put_data(buf,4);
|
||||
|
||||
}
|
||||
void StreamPeer::put_double(double p_val){
|
||||
|
||||
uint8_t buf[8];
|
||||
encode_double(p_val,buf);
|
||||
if (big_endian) {
|
||||
uint64_t *p64=(uint64_t *)buf;
|
||||
*p64=BSWAP64(*p64);
|
||||
}
|
||||
put_data(buf,8);
|
||||
|
||||
}
|
||||
void StreamPeer::put_utf8_string(const String& p_string) {
|
||||
|
||||
CharString cs=p_string.utf8();
|
||||
put_data((const uint8_t*)cs.get_data(),cs.length());
|
||||
|
||||
}
|
||||
void StreamPeer::put_var(const Variant& p_variant){
|
||||
|
||||
int len=0;
|
||||
Vector<uint8_t> buf;
|
||||
encode_variant(p_variant,NULL,len);
|
||||
buf.resize(len);
|
||||
put_32(len);
|
||||
encode_variant(p_variant,buf.ptr(),len);
|
||||
put_data(buf.ptr(),buf.size());
|
||||
|
||||
|
||||
}
|
||||
|
||||
uint8_t StreamPeer::get_u8(){
|
||||
|
||||
uint8_t buf[1];
|
||||
get_data(buf,1);
|
||||
return buf[0];
|
||||
}
|
||||
int8_t StreamPeer::get_8(){
|
||||
|
||||
uint8_t buf[1];
|
||||
get_data(buf,1);
|
||||
return buf[0];
|
||||
|
||||
}
|
||||
uint16_t StreamPeer::get_u16(){
|
||||
|
||||
uint8_t buf[2];
|
||||
get_data(buf,2);
|
||||
uint16_t r = decode_uint16(buf);
|
||||
if (big_endian) {
|
||||
r=BSWAP16(r);
|
||||
}
|
||||
return r;
|
||||
|
||||
}
|
||||
int16_t StreamPeer::get_16(){
|
||||
|
||||
uint8_t buf[2];
|
||||
get_data(buf,2);
|
||||
uint16_t r = decode_uint16(buf);
|
||||
if (big_endian) {
|
||||
r=BSWAP16(r);
|
||||
}
|
||||
return r;
|
||||
|
||||
}
|
||||
uint32_t StreamPeer::get_u32(){
|
||||
|
||||
uint8_t buf[4];
|
||||
get_data(buf,4);
|
||||
uint32_t r = decode_uint32(buf);
|
||||
if (big_endian) {
|
||||
r=BSWAP32(r);
|
||||
}
|
||||
return r;
|
||||
|
||||
}
|
||||
int32_t StreamPeer::get_32(){
|
||||
|
||||
uint8_t buf[4];
|
||||
get_data(buf,4);
|
||||
uint32_t r = decode_uint32(buf);
|
||||
if (big_endian) {
|
||||
r=BSWAP32(r);
|
||||
}
|
||||
return r;
|
||||
|
||||
}
|
||||
uint64_t StreamPeer::get_u64(){
|
||||
|
||||
uint8_t buf[8];
|
||||
get_data(buf,8);
|
||||
uint64_t r = decode_uint64(buf);
|
||||
if (big_endian) {
|
||||
r=BSWAP64(r);
|
||||
}
|
||||
return r;
|
||||
|
||||
}
|
||||
int64_t StreamPeer::get_64(){
|
||||
|
||||
uint8_t buf[8];
|
||||
get_data(buf,8);
|
||||
uint64_t r = decode_uint64(buf);
|
||||
if (big_endian) {
|
||||
r=BSWAP64(r);
|
||||
}
|
||||
return r;
|
||||
|
||||
}
|
||||
float StreamPeer::get_float(){
|
||||
|
||||
uint8_t buf[4];
|
||||
get_data(buf,4);
|
||||
|
||||
if (big_endian) {
|
||||
uint32_t *p32=(uint32_t *)buf;
|
||||
*p32=BSWAP32(*p32);
|
||||
}
|
||||
|
||||
return decode_float(buf);
|
||||
}
|
||||
|
||||
float StreamPeer::get_double(){
|
||||
|
||||
uint8_t buf[8];
|
||||
get_data(buf,8);
|
||||
|
||||
if (big_endian) {
|
||||
uint64_t *p64=(uint64_t *)buf;
|
||||
*p64=BSWAP64(*p64);
|
||||
}
|
||||
|
||||
return decode_double(buf);
|
||||
|
||||
}
|
||||
String StreamPeer::get_string(int p_bytes){
|
||||
|
||||
ERR_FAIL_COND_V(p_bytes<0,String());
|
||||
|
||||
Vector<char> buf;
|
||||
buf.resize(p_bytes+1);
|
||||
get_data((uint8_t*)&buf[0],p_bytes);
|
||||
buf[p_bytes]=0;
|
||||
return buf.ptr();
|
||||
|
||||
}
|
||||
String StreamPeer::get_utf8_string(int p_bytes){
|
||||
|
||||
ERR_FAIL_COND_V(p_bytes<0,String());
|
||||
ERR_FAIL_COND_V(p_bytes<0,String());
|
||||
|
||||
Vector<uint8_t> buf;
|
||||
buf.resize(p_bytes);
|
||||
get_data(buf.ptr(),p_bytes);
|
||||
|
||||
String ret;
|
||||
ret.parse_utf8((const char*)buf.ptr(),buf.size());
|
||||
return ret;
|
||||
|
||||
}
|
||||
Variant StreamPeer::get_var(){
|
||||
|
||||
int len = get_32();
|
||||
Vector<uint8_t> var;
|
||||
var.resize(len);
|
||||
get_data(var.ptr(),len);
|
||||
|
||||
Variant ret;
|
||||
decode_variant(ret,var.ptr(),len);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void StreamPeer::_bind_methods() {
|
||||
|
||||
|
@ -123,4 +388,36 @@ void StreamPeer::_bind_methods() {
|
|||
|
||||
ObjectTypeDB::bind_method(_MD("get_data","bytes"),&StreamPeer::_get_data);
|
||||
ObjectTypeDB::bind_method(_MD("get_partial_data","bytes"),&StreamPeer::_get_partial_data);
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("get_available_bytes"),&StreamPeer::get_available_bytes);
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("set_big_endian","enable"),&StreamPeer::set_big_endian);
|
||||
ObjectTypeDB::bind_method(_MD("is_big_endian_enabled"),&StreamPeer::is_big_endian_enabled);
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("put_8","val"),&StreamPeer::put_8);
|
||||
ObjectTypeDB::bind_method(_MD("put_u8","val"),&StreamPeer::put_u8);
|
||||
ObjectTypeDB::bind_method(_MD("put_16","val"),&StreamPeer::put_16);
|
||||
ObjectTypeDB::bind_method(_MD("put_u16","val"),&StreamPeer::put_u16);
|
||||
ObjectTypeDB::bind_method(_MD("put_32","val"),&StreamPeer::put_32);
|
||||
ObjectTypeDB::bind_method(_MD("put_u32","val"),&StreamPeer::put_u32);
|
||||
ObjectTypeDB::bind_method(_MD("put_64","val"),&StreamPeer::put_64);
|
||||
ObjectTypeDB::bind_method(_MD("put_u64","val"),&StreamPeer::put_u64);
|
||||
ObjectTypeDB::bind_method(_MD("put_float","val"),&StreamPeer::put_float);
|
||||
ObjectTypeDB::bind_method(_MD("put_double","val"),&StreamPeer::put_double);
|
||||
ObjectTypeDB::bind_method(_MD("put_utf8_string","val"),&StreamPeer::put_utf8_string);
|
||||
ObjectTypeDB::bind_method(_MD("put_var","val:Variant"),&StreamPeer::put_var);
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("get_8"),&StreamPeer::get_8);
|
||||
ObjectTypeDB::bind_method(_MD("get_u8"),&StreamPeer::get_u8);
|
||||
ObjectTypeDB::bind_method(_MD("get_16"),&StreamPeer::get_16);
|
||||
ObjectTypeDB::bind_method(_MD("get_u16"),&StreamPeer::get_u16);
|
||||
ObjectTypeDB::bind_method(_MD("get_32"),&StreamPeer::get_32);
|
||||
ObjectTypeDB::bind_method(_MD("get_u32"),&StreamPeer::get_u32);
|
||||
ObjectTypeDB::bind_method(_MD("get_64"),&StreamPeer::get_64);
|
||||
ObjectTypeDB::bind_method(_MD("get_u64"),&StreamPeer::get_u64);
|
||||
ObjectTypeDB::bind_method(_MD("get_float"),&StreamPeer::get_float);
|
||||
ObjectTypeDB::bind_method(_MD("get_double"),&StreamPeer::get_double);
|
||||
ObjectTypeDB::bind_method(_MD("get_string","bytes"),&StreamPeer::get_string);
|
||||
ObjectTypeDB::bind_method(_MD("get_utf8_string","bytes"),&StreamPeer::get_utf8_string);
|
||||
ObjectTypeDB::bind_method(_MD("get_var:Variant"),&StreamPeer::get_var);
|
||||
}
|
||||
|
|
|
@ -44,6 +44,8 @@ protected:
|
|||
Array _get_data(int p_bytes);
|
||||
Array _get_partial_data(int p_bytes);
|
||||
|
||||
bool big_endian;
|
||||
|
||||
public:
|
||||
|
||||
virtual Error put_data(const uint8_t* p_data,int p_bytes)=0; ///< put a whole chunk of data, blocking until it sent
|
||||
|
@ -52,7 +54,41 @@ public:
|
|||
virtual Error get_data(uint8_t* p_buffer, int p_bytes)=0; ///< read p_bytes of data, if p_bytes > available, it will block
|
||||
virtual Error get_partial_data(uint8_t* p_buffer, int p_bytes,int &r_received)=0; ///< read as much data as p_bytes into buffer, if less was read, return in r_received
|
||||
|
||||
StreamPeer() {}
|
||||
virtual int get_available_bytes() const=0;
|
||||
|
||||
void set_big_endian(bool p_enable);
|
||||
bool is_big_endian_enabled() const;
|
||||
|
||||
void put_8(int8_t p_val);
|
||||
void put_u8(uint8_t p_val);
|
||||
void put_16(int16_t p_val);
|
||||
void put_u16(uint16_t p_val);
|
||||
void put_32(int32_t p_val);
|
||||
void put_u32(uint32_t p_val);
|
||||
void put_64(int64_t p_val);
|
||||
void put_u64(uint64_t p_val);
|
||||
void put_float(float p_val);
|
||||
void put_double(double p_val);
|
||||
void put_utf8_string(const String& p_string);
|
||||
void put_var(const Variant& p_variant);
|
||||
|
||||
uint8_t get_u8();
|
||||
int8_t get_8();
|
||||
uint16_t get_u16();
|
||||
int16_t get_16();
|
||||
uint32_t get_u32();
|
||||
int32_t get_32();
|
||||
uint64_t get_u64();
|
||||
int64_t get_64();
|
||||
float get_float();
|
||||
float get_double();
|
||||
String get_string(int p_bytes);
|
||||
String get_utf8_string(int p_bytes);
|
||||
Variant get_var();
|
||||
|
||||
|
||||
|
||||
StreamPeer() { big_endian=false; }
|
||||
};
|
||||
|
||||
#endif // STREAM_PEER_H
|
||||
|
|
|
@ -886,7 +886,38 @@ public:
|
|||
}
|
||||
|
||||
|
||||
static double vec2_cross(const Point2 &O, const Point2 &A, const Point2 &B)
|
||||
{
|
||||
return (double)(A.x - O.x) * (B.y - O.y) - (double)(A.y - O.y) * (B.x - O.x);
|
||||
}
|
||||
|
||||
// Returns a list of points on the convex hull in counter-clockwise order.
|
||||
// Note: the last point in the returned list is the same as the first one.
|
||||
static Vector<Point2> convex_hull_2d(Vector<Point2> P)
|
||||
{
|
||||
int n = P.size(), k = 0;
|
||||
Vector<Point2> H;
|
||||
H.resize(2*n);
|
||||
|
||||
// Sort points lexicographically
|
||||
P.sort();
|
||||
|
||||
|
||||
// Build lower hull
|
||||
for (int i = 0; i < n; ++i) {
|
||||
while (k >= 2 && vec2_cross(H[k-2], H[k-1], P[i]) <= 0) k--;
|
||||
H[k++] = P[i];
|
||||
}
|
||||
|
||||
// Build upper hull
|
||||
for (int i = n-2, t = k+1; i >= 0; i--) {
|
||||
while (k >= t && vec2_cross(H[k-2], H[k-1], P[i]) <= 0) k--;
|
||||
H[k++] = P[i];
|
||||
}
|
||||
|
||||
H.resize(k);
|
||||
return H;
|
||||
}
|
||||
|
||||
static MeshData build_convex_mesh(const DVector<Plane> &p_planes);
|
||||
static DVector<Plane> build_sphere_planes(float p_radius, int p_lats, int p_lons, Vector3::Axis p_axis=Vector3::AXIS_Z);
|
||||
|
|
|
@ -1613,7 +1613,7 @@ void Object::_bind_methods() {
|
|||
ObjectTypeDB::bind_native_method(METHOD_FLAGS_DEFAULT,"call_deferred",&Object::_call_deferred_bind,mi,defargs);
|
||||
}
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("callv:var","method","arg_array"),&Object::callv);
|
||||
ObjectTypeDB::bind_method(_MD("callv:Variant","method","arg_array"),&Object::callv);
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("has_method"),&Object::has_method);
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ public:
|
|||
|
||||
#ifdef TOOLS_ENABLED
|
||||
|
||||
void set_last_modified_time(uint64_t p_time) { last_modified_time=p_time; }
|
||||
virtual void set_last_modified_time(uint64_t p_time) { last_modified_time=p_time; }
|
||||
uint64_t get_last_modified_time() const { return last_modified_time; }
|
||||
|
||||
#endif
|
||||
|
|
|
@ -197,10 +197,22 @@ static inline int get_shift_from_power_of_2( unsigned int p_pixel ) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
/** Swap 16 bits value for endianness */
|
||||
static inline uint16_t BSWAP16(uint16_t x) {
|
||||
return (x>>8)|(x<<8);
|
||||
}
|
||||
/** Swap 32 bits value for endianness */
|
||||
static inline uint32_t BSWAP32(uint32_t x) {
|
||||
return((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24));
|
||||
}
|
||||
/** Swap 64 bits value for endianness */
|
||||
|
||||
static inline uint64_t BSWAP64(uint64_t x) {
|
||||
x = (x & 0x00000000FFFFFFFF) << 32 | (x & 0xFFFFFFFF00000000) >> 32;
|
||||
x = (x & 0x0000FFFF0000FFFF) << 16 | (x & 0xFFFF0000FFFF0000) >> 16;
|
||||
x = (x & 0x00FF00FF00FF00FF) << 8 | (x & 0xFF00FF00FF00FF00) >> 8;
|
||||
return x;
|
||||
}
|
||||
|
||||
/** When compiling with RTTI, we can add an "extra"
|
||||
* layer of safeness in many operations, so dynamic_cast
|
||||
|
|
|
@ -482,8 +482,8 @@ void UndoRedo::_bind_methods() {
|
|||
ObjectTypeDB::bind_native_method(METHOD_FLAGS_DEFAULT,"add_undo_method",&UndoRedo::_add_undo_method,mi,defargs);
|
||||
}
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("add_do_property","object", "property", "value:var"),&UndoRedo::add_do_property);
|
||||
ObjectTypeDB::bind_method(_MD("add_undo_property","object", "property", "value:var"),&UndoRedo::add_undo_property);
|
||||
ObjectTypeDB::bind_method(_MD("add_do_property","object", "property", "value:Variant"),&UndoRedo::add_do_property);
|
||||
ObjectTypeDB::bind_method(_MD("add_undo_property","object", "property", "value:Variant"),&UndoRedo::add_undo_property);
|
||||
ObjectTypeDB::bind_method(_MD("add_do_reference","object"),&UndoRedo::add_do_reference);
|
||||
ObjectTypeDB::bind_method(_MD("add_undo_reference","object"),&UndoRedo::add_undo_reference);
|
||||
ObjectTypeDB::bind_method(_MD("clear_history"),&UndoRedo::clear_history);
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
extends Node
|
||||
|
||||
# Member variables
|
||||
var current_scene = null
|
||||
|
||||
# Changing scenes is most easily done using the functions `change_scene`
|
||||
# and `change_scene_to` of the SceneTree. This script demonstrates how to
|
||||
# change scenes without those helpers.
|
||||
|
||||
|
||||
func goto_scene(path):
|
||||
|
@ -18,20 +20,17 @@ func goto_scene(path):
|
|||
|
||||
|
||||
func _deferred_goto_scene(path):
|
||||
# Immediately free the current scene,
|
||||
# there is no risk here.
|
||||
current_scene.free()
|
||||
# Immediately free the current scene, there is no risk here.
|
||||
get_tree().get_current_scene().free()
|
||||
|
||||
# Load new scene
|
||||
var s = ResourceLoader.load(path)
|
||||
var packed_scene = ResourceLoader.load(path)
|
||||
|
||||
# Instance the new scene
|
||||
current_scene = s.instance()
|
||||
var instanced_scene = packed_scene.instance()
|
||||
|
||||
# Add it to the active scene, as child of root
|
||||
get_tree().get_root().add_child(current_scene)
|
||||
|
||||
|
||||
func _ready():
|
||||
# Get the current scene at the time of initialization
|
||||
current_scene = get_tree().get_current_scene()
|
||||
# Add it to the scene tree, as direct child of root
|
||||
get_tree().get_root().add_child(instanced_scene)
|
||||
|
||||
# Set it as the current scene, only after it has been added to the tree
|
||||
get_tree().set_current_scene(instanced_scene)
|
||||
|
|
|
@ -1,16 +1,5 @@
|
|||
|
||||
extends Panel
|
||||
|
||||
# Member variables here, example:
|
||||
# var a=2
|
||||
# var b="textvar"
|
||||
|
||||
|
||||
func _ready():
|
||||
# Initalization here
|
||||
pass
|
||||
|
||||
|
||||
func _on_goto_scene_pressed():
|
||||
get_node("/root/global").goto_scene("res://scene_b.scn")
|
||||
pass # Replace with function body
|
||||
|
|
|
@ -1,16 +1,5 @@
|
|||
|
||||
extends Panel
|
||||
|
||||
# Member variables here, example:
|
||||
# var a=2
|
||||
# var b="textvar"
|
||||
|
||||
|
||||
func _ready():
|
||||
# Initalization here
|
||||
pass
|
||||
|
||||
|
||||
func _on_goto_scene_pressed():
|
||||
get_node("/root/global").goto_scene("res://scene_a.scn")
|
||||
pass # Replace with function body
|
||||
|
|
|
@ -51,14 +51,14 @@ PROJECT_BRIEF = "Game Engine MIT"
|
|||
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
|
||||
# the logo to the output directory.
|
||||
|
||||
PROJECT_LOGO = ./logo_small.png
|
||||
PROJECT_LOGO = ../logo.png
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
|
||||
# into which the generated documentation will be written. If a relative path is
|
||||
# entered, it will be relative to the location where doxygen was started. If
|
||||
# left blank the current directory will be used.
|
||||
|
||||
OUTPUT_DIRECTORY = ./doc/doxygen/
|
||||
OUTPUT_DIRECTORY = ./_build/doxygen/
|
||||
|
||||
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
|
||||
# directories (in 2 levels) under the output directory of each output format and
|
||||
|
@ -768,7 +768,7 @@ WARN_LOGFILE =
|
|||
# spaces.
|
||||
# Note: If this tag is empty the current directory is searched.
|
||||
|
||||
INPUT = ./core/ ./main/ ./scene/
|
||||
INPUT = ../core/ ../main/ ../scene/
|
||||
|
||||
# This tag can be used to specify the character encoding of the source files
|
||||
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
|
|
@ -0,0 +1,47 @@
|
|||
BASEDIR = $(CURDIR)
|
||||
CLASSES = $(BASEDIR)/base/classes.xml
|
||||
OUTPUTDIR = $(BASEDIR)/_build
|
||||
TOOLSDIR = $(BASEDIR)/tools
|
||||
|
||||
.ONESHELL:
|
||||
|
||||
clean:
|
||||
rm -rf $(OUTPUTDIR)
|
||||
|
||||
doku:
|
||||
rm -rf $(OUTPUTDIR)/doku
|
||||
mkdir -p $(OUTPUTDIR)/doku
|
||||
pushd $(OUTPUTDIR)/doku
|
||||
python2 $(TOOLSDIR)/makedoku.py $(CLASSES)
|
||||
popd
|
||||
|
||||
doxygen:
|
||||
rm -rf $(OUTPUTDIR)/doxygen
|
||||
mkdir -p $(OUTPUTDIR)/doxygen
|
||||
doxygen Doxyfile
|
||||
|
||||
html:
|
||||
rm -rf $(OUTPUTDIR)/html
|
||||
mkdir -p $(OUTPUTDIR)/html
|
||||
pushd $(OUTPUTDIR)/html
|
||||
python2 $(TOOLSDIR)/makehtml.py -multipage $(CLASSES)
|
||||
popd
|
||||
|
||||
markdown:
|
||||
rm -rf $(OUTPUTDIR)/markdown
|
||||
mkdir -p $(OUTPUTDIR)/markdown
|
||||
pushd $(OUTPUTDIR)/markdown
|
||||
python2 $(TOOLSDIR)/makemd.py $(CLASSES)
|
||||
popd
|
||||
|
||||
rst:
|
||||
rm -rf $(OUTPUTDIR)/rst
|
||||
mkdir -p $(OUTPUTDIR)/rst
|
||||
pushd $(OUTPUTDIR)/rst
|
||||
echo "TODO"
|
||||
popd
|
||||
|
||||
textile:
|
||||
rm -rf $(OUTPUTDIR)/textile
|
||||
mkdir -p $(OUTPUTDIR)/textile
|
||||
python3 $(TOOLSDIR)/makedocs.py --input $(CLASSES) --output $(OUTPUTDIR)/textile
|
2654
doc/core_classes.xml
|
@ -1,33 +0,0 @@
|
|||
deferred:
|
||||
|
||||
ar ag ab gl - accumulation RGB + glow
|
||||
|
||||
nx ny mx my? - normal, motion
|
||||
dr dg db sm - diffuse, shademodel
|
||||
sr sg sb sp - specular OR shadeparams
|
||||
|
||||
ar ag ab gl
|
||||
nx ny sp sp
|
||||
dr dg db se
|
||||
444 6
|
||||
se can be 6 bits, 2 for shade model
|
||||
|
||||
shade models:
|
||||
|
||||
0 - none
|
||||
1 - wrap
|
||||
2 - toon
|
||||
3 - fresne
|
||||
|
||||
|
||||
|
||||
sp: 2 bits what - 6 bits param
|
||||
|
||||
16
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
-Oceano
|
||||
-Portales
|
||||
-Grilla
|
||||
-Personaje
|
||||
-Auto (?)
|
||||
-Fisica
|
||||
-Fisica Idle
|
||||
-Low level APIS (Server)
|
||||
-Sonido Posicional
|
||||
-Custom Shaders
|
||||
-HDR
|
||||
-Trees Waving
|
||||
-luces
|
||||
-fixed material
|
||||
-shader material
|
||||
-synctoaudio speech and speex
|
||||
-particulas con gif animados para mostrar que es cada parametro
|
||||
-soporte de syntax hilight de gdscript para editores mas comunes
|
||||
-instanciar enemigos usando duplicate
|
||||
-simulated motion con animacion
|
||||
-animation player controla otro animation player (tipo camina de lugar a otro y saluda)
|
||||
-corutinas y loops con yield para animation, audio, etc
|
||||
-CCD (bullets)
|
||||
|
||||
-custom gizmos, editor plugins en script
|
||||
|
||||
Clases que necesitan tutorial.
|
||||
|
||||
Animation/AnimationPlayer
|
||||
Area2D (space override, notifications)
|
||||
custom container demo
|
||||
custon drawing in a canvas item
|
||||
ignore mouse on top of button
|
||||
input in a game, with _unhandled_input
|
||||
demo containers
|
||||
Control, anchors e input event handling
|
||||
lots of 2D physics examples
|
||||
dictionary and array doc of passing by reference?
|
||||
|
||||
|
17940
doc/engine_classes.xml
|
@ -1,295 +0,0 @@
|
|||
|
||||
class PhysicsTestBase extends MainLoopScripted {
|
||||
|
||||
|
||||
bodies=[]
|
||||
type_mesh_map={}
|
||||
type_shape_map={}
|
||||
cameratr=Transform()
|
||||
|
||||
|
||||
function body_changed_transform(p_transform, p_velocity, p_angular_velocity,p_sleeping, p_visual_instance) {
|
||||
|
||||
VisualServer.instance_set_transform(p_visual_instance,p_transform);
|
||||
}
|
||||
|
||||
|
||||
function create_body(p_shape, p_body_mode, p_location, p_active=true) {
|
||||
|
||||
local mesh_instance = VisualServer.instance_create( type_mesh_map[p_shape] )
|
||||
local body = PhysicsServer.body_create(RID(),p_body_mode,!p_active)
|
||||
PhysicsServer.body_add_shape(body,type_shape_map[p_shape])
|
||||
|
||||
local query = PhysicsServer.query_create(this,"body_changed_transform",mesh_instance)
|
||||
PhysicsServer.query_body_state(query, body)
|
||||
|
||||
PhysicsServer.body_set_state( body, PhysicsServer.BODY_STATE_TRANSFORM, p_location )
|
||||
bodies.append( body )
|
||||
return body
|
||||
|
||||
}
|
||||
|
||||
|
||||
function create_static_plane(p_plane) {
|
||||
|
||||
local plane_shape = PhysicsServer.shape_create(PhysicsServer.SHAPE_PLANE)
|
||||
PhysicsServer.shape_set_data( plane_shape, p_plane );
|
||||
|
||||
local b = PhysicsServer.body_create(RID(), PhysicsServer.BODY_MODE_STATIC );
|
||||
PhysicsServer.body_add_shape(b, plane_shape);
|
||||
return b;
|
||||
}
|
||||
|
||||
function configure_body( p_body, p_mass, p_friction, p_bounce) {
|
||||
|
||||
PhysicsServer.body_set_param( p_body, PhysicsServer.BODY_PARAM_MASS, p_mass );
|
||||
PhysicsServer.body_set_param( p_body, PhysicsServer.BODY_PARAM_FRICTION, p_friction );
|
||||
PhysicsServer.body_set_param( p_body, PhysicsServer.BODY_PARAM_BOUNCE, p_bounce );
|
||||
|
||||
}
|
||||
|
||||
function init_shapes() {
|
||||
|
||||
|
||||
/* SPHERE SHAPE */
|
||||
local sphere_mesh = VisualServer.make_sphere_mesh(10,20,1.0);
|
||||
local sphere_material = VisualServer.fixed_material_create();
|
||||
//VisualServer.material_set_flag( sphere_material, VisualServer.MATERIAL_FLAG_WIREFRAME, true );
|
||||
VisualServer.fixed_material_set_parameter( sphere_material, VisualServer.FIXED_MATERIAL_PARAM_DIFFUSE, Color(0.7,0.8,3.0) );
|
||||
VisualServer.mesh_surface_set_material( sphere_mesh, 0, sphere_material );
|
||||
type_mesh_map[PhysicsServer.SHAPE_SPHERE] <- sphere_mesh;
|
||||
|
||||
local sphere_shape=PhysicsServer.shape_create(PhysicsServer.SHAPE_SPHERE);
|
||||
PhysicsServer.shape_set_data( sphere_shape, 1.0 );
|
||||
type_shape_map[PhysicsServer.SHAPE_SPHERE] <- sphere_shape;
|
||||
|
||||
/* BOX SHAPE */
|
||||
|
||||
local box_planes = GeometryUtils.build_box_planes(Vector3(0.5,0.5,0.5));
|
||||
local box_material = VisualServer.fixed_material_create();
|
||||
VisualServer.fixed_material_set_parameter( box_material, VisualServer.FIXED_MATERIAL_PARAM_DIFFUSE, Color(1.0,0.2,0.2) );
|
||||
local box_mesh = VisualServer.mesh_create();
|
||||
|
||||
VisualServer.mesh_add_surface_from_planes(box_mesh,box_planes);
|
||||
VisualServer.mesh_surface_set_material( box_mesh, 0, box_material );
|
||||
type_mesh_map[PhysicsServer.SHAPE_BOX]<- box_mesh;
|
||||
|
||||
local box_shape=PhysicsServer.shape_create(PhysicsServer.SHAPE_BOX);
|
||||
PhysicsServer.shape_set_data( box_shape, Vector3(0.5,0.5,0.5) );
|
||||
type_shape_map[PhysicsServer.SHAPE_BOX]<- box_shape;
|
||||
|
||||
/* CYLINDER SHAPE */
|
||||
|
||||
local cylinder_planes = GeometryUtils.build_cylinder_planes(0.5,1,12
|
||||
,Vector3.AXIS_Z);
|
||||
local cylinder_material = VisualServer.fixed_material_create();
|
||||
VisualServer.fixed_material_set_parameter( cylinder_material, VisualServer.FIXED_MATERIAL_PARAM_DIFFUSE, Color(0.3,0.4,1.0) );
|
||||
local cylinder_mesh = VisualServer.mesh_create();
|
||||
|
||||
VisualServer.mesh_add_surface_from_planes(cylinder_mesh,cylinder_planes);
|
||||
VisualServer.mesh_surface_set_material( cylinder_mesh, 0, cylinder_material );
|
||||
type_mesh_map[PhysicsServer.SHAPE_CYLINDER]<- cylinder_mesh;
|
||||
|
||||
local cylinder_shape=PhysicsServer.shape_create(PhysicsServer.SHAPE_CYLINDER);
|
||||
local cylinder_params={}
|
||||
cylinder_params["radius"]<- 0.5;
|
||||
cylinder_params["height"]<- 2;
|
||||
PhysicsServer.shape_set_data( cylinder_shape, cylinder_params );
|
||||
type_shape_map[PhysicsServer.SHAPE_CYLINDER]<- cylinder_shape;
|
||||
|
||||
/* CAPSULE SHAPE */
|
||||
|
||||
local capsule_planes = GeometryUtils.build_capsule_planes(0.5,0.7,12,Vector3.AXIS_Z);
|
||||
local capsule_material = VisualServer.fixed_material_create();
|
||||
VisualServer.fixed_material_set_parameter( capsule_material, VisualServer.FIXED_MATERIAL_PARAM_DIFFUSE, Color(0.3,0.4,1.0) );
|
||||
|
||||
local capsule_mesh = VisualServer.mesh_create();
|
||||
|
||||
VisualServer.mesh_add_surface_from_planes(capsule_mesh,capsule_planes);
|
||||
VisualServer.mesh_surface_set_material( capsule_mesh, 0, capsule_material );
|
||||
type_mesh_map[PhysicsServer.SHAPE_CAPSULE]<-capsule_mesh;
|
||||
|
||||
local capsule_shape=PhysicsServer.shape_create(PhysicsServer.SHAPE_CAPSULE);
|
||||
local capsule_params={}
|
||||
capsule_params["radius"]<- 0.5;
|
||||
capsule_params["height"]<- 1.4;
|
||||
PhysicsServer.shape_set_data( capsule_shape, capsule_params );
|
||||
type_shape_map[PhysicsServer.SHAPE_CAPSULE]<- capsule_shape;
|
||||
|
||||
/* CONVEX SHAPE */
|
||||
|
||||
local convex_planes = GeometryUtils.build_cylinder_planes(0.5,0.7,5,Vector3.AXIS_Z);
|
||||
local convex_material = VisualServer.fixed_material_create();
|
||||
VisualServer.fixed_material_set_parameter( convex_material, VisualServer.FIXED_MATERIAL_PARAM_DIFFUSE, Color(0.8,0.2,0.9));
|
||||
|
||||
local convex_mesh = VisualServer.mesh_create();
|
||||
VisualServer.mesh_add_surface_from_planes(convex_mesh,convex_planes);
|
||||
VisualServer.mesh_surface_set_material( convex_mesh, 0, convex_material );
|
||||
type_mesh_map[PhysicsServer.SHAPE_CONVEX_POLYGON]<- convex_mesh;
|
||||
|
||||
local convex_shape=PhysicsServer.shape_create(PhysicsServer.SHAPE_CONVEX_POLYGON);
|
||||
PhysicsServer.shape_set_data( convex_shape, convex_planes );
|
||||
type_shape_map[PhysicsServer.SHAPE_CONVEX_POLYGON]<- convex_shape;
|
||||
|
||||
}
|
||||
|
||||
function make_trimesh(p_faces,p_xform=Transform()) {
|
||||
|
||||
local trimesh_shape = PhysicsServer.shape_create(PhysicsServer.SHAPE_CONCAVE_POLYGON);
|
||||
PhysicsServer.shape_set_data(trimesh_shape, p_faces);
|
||||
p_faces=PhysicsServer.shape_get_data(trimesh_shape); // optimized one
|
||||
normals=[]
|
||||
|
||||
for (i=0;i<p_faces.length()/3;i++) {
|
||||
|
||||
p=Plane( p_faces[i*3+0],p_faces[i*3+1], p_faces[i*3+2] );
|
||||
normals.append(p.normal);
|
||||
normals.append(p.normal);
|
||||
normals.append(p.normal);
|
||||
}
|
||||
|
||||
local trimesh_mesh = VisualServer.mesh_create();
|
||||
VisualServer.mesh_add_surface(trimesh_mesh, VS::PRIMITIVE_TRIANGLES, VS::ARRAY_FORMAT_VERTEX|VS::ARRAY_FORMAT_NORMAL, p_faces.length() );
|
||||
VisualServer.mesh_surface_set_array(trimesh_mesh,0,VS::ARRAY_VERTEX, p_faces );
|
||||
VisualServer.mesh_surface_set_array(trimesh_mesh,0,VS::ARRAY_NORMAL, normals );
|
||||
local trimesh_mat = VisualServer.fixed_material_create();
|
||||
VisualServer.fixed_material_set_parameter( trimesh_mat, VisualServer.FIXED_MATERIAL_PARAM_DIFFUSE, Color(1.0,0.5,0.8));
|
||||
//VisualServer.material_set_flag( trimesh_mat, VisualServer.MATERIAL_FLAG_UNSHADED,true);
|
||||
VisualServer.mesh_surface_set_material( trimesh_mesh, 0, trimesh_mat );
|
||||
|
||||
local triins = VisualServer.instance_create(trimesh_mesh);
|
||||
|
||||
|
||||
local tribody = PhysicsServer.body_create(RID(), PhysicsServer.BODY_MODE_STATIC);
|
||||
PhysicsServer.body_add_shape(tribody, trimesh_shape);
|
||||
tritrans = p_xform;
|
||||
PhysicsServer.body_set_state( tribody, PhysicsServer.BODY_STATE_TRANSFORM, tritrans );
|
||||
VisualServer.instance_set_transform( triins, tritrans );
|
||||
//RID trimesh_material = VisualServer.fixed_material_create();
|
||||
//VisualServer.material_generate( trimesh_material, Color(0.2,0.4,0.6) );
|
||||
//VisualServer.mesh_surface_set_material( trimesh_mesh, 0, trimesh_material );
|
||||
|
||||
}
|
||||
|
||||
function make_grid(p_width,p_height,p_cellsize,p_cellheight,p_xform=Transform()) {
|
||||
|
||||
local grid = []
|
||||
|
||||
for (local i =0;i<p_width;i++) {
|
||||
|
||||
local row = []
|
||||
|
||||
for (local j=0;j<p_height;j++) {
|
||||
|
||||
local val = 1.0+Math.random(-p_cellheight, p_cellheight );
|
||||
row.append(val)
|
||||
}
|
||||
grid.append(row)
|
||||
}
|
||||
|
||||
local faces=[]
|
||||
|
||||
for (local i =1;i<p_width;i++) {
|
||||
|
||||
for (local j=1;j<p_height;j++) {
|
||||
|
||||
function MAKE_VERTEX(m_x,m_z) {
|
||||
local v= Vector3( (m_x-p_width/2)*p_cellsize, grid[m_x][m_z], (m_z-p_height/2)*p_cellsize )
|
||||
faces.push_back(v)
|
||||
}
|
||||
|
||||
|
||||
MAKE_VERTEX(i,j-1)
|
||||
MAKE_VERTEX(i,j)
|
||||
MAKE_VERTEX(i-1,j)
|
||||
|
||||
MAKE_VERTEX(i-1,j-1)
|
||||
MAKE_VERTEX(i,j-1)
|
||||
MAKE_VERTEX(i-1,j)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
make_trimesh(faces,p_xform);
|
||||
}
|
||||
|
||||
quit=false
|
||||
|
||||
transform = Transform()
|
||||
camera=RID()
|
||||
|
||||
function init_internal() {}
|
||||
function iteration_internal(time) {}
|
||||
//public
|
||||
|
||||
|
||||
function input_event(p_event) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
function request_quit() {
|
||||
|
||||
quit=true;
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
init_shapes();
|
||||
|
||||
|
||||
/* LIGHT */
|
||||
local lightaux = VisualServer.light_create( VisualServer.LIGHT_DIRECTIONAL );
|
||||
//VisualServer.light_set_color( lightaux, VisualServer.LIGHT_COLOR_AMBIENT, Color(0.0,0.0,0.0) );
|
||||
VisualServer.light_set_shadow(lightaux,true);
|
||||
local light = VisualServer.instance_create( lightaux );
|
||||
local t=Transform()
|
||||
t.rotate(Vector3(1.0,0,0),0.6);
|
||||
VisualServer.instance_set_transform(light,t);
|
||||
|
||||
|
||||
/* CAMERA */
|
||||
|
||||
camera = VisualServer.camera_create();
|
||||
local viewport = VisualServer.viewport_create();
|
||||
VisualServer.viewport_attach_camera( viewport, camera );
|
||||
VisualServer.viewport_set_parent(viewport, RID() );
|
||||
|
||||
VisualServer.camera_set_perspective(camera,60,0.1,20.0);
|
||||
cameratr=Transform( Matrix3(), Vector3(0,2,8))
|
||||
VisualServer.camera_set_transform(camera,cameratr);
|
||||
|
||||
quit=false;
|
||||
|
||||
init_internal()
|
||||
|
||||
}
|
||||
|
||||
|
||||
function iteration(p_time) {
|
||||
|
||||
// VisualServer.camera_set_transform(camera,cameratr);
|
||||
iteration_internal(p_time)
|
||||
|
||||
return quit;
|
||||
}
|
||||
|
||||
function idle(p_time) {
|
||||
|
||||
return quit;
|
||||
}
|
||||
|
||||
|
||||
function finish() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
constructor() {
|
||||
MainLoopScripted.constructor();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return PhysicsTestBase;
|
|
@ -1,42 +0,0 @@
|
|||
|
||||
include("test_base.sq")
|
||||
|
||||
class TestFall extends PhysicsTestBase {
|
||||
|
||||
|
||||
fall_elements=10
|
||||
|
||||
function init_internal() {
|
||||
|
||||
for (local i=0;i<10;i++) {
|
||||
|
||||
local shape_idx=[
|
||||
PhysicsServer.SHAPE_SPHERE,
|
||||
PhysicsServer.SHAPE_BOX,
|
||||
PhysicsServer.SHAPE_CAPSULE,
|
||||
PhysicsServer.SHAPE_CYLINDER,
|
||||
PhysicsServer.SHAPE_CONVEX_POLYGON
|
||||
];
|
||||
|
||||
local stype=shape_idx[i%5];
|
||||
// stype=PhysicsServer.SHAPE_SPHERE;
|
||||
|
||||
local t=Transform()
|
||||
t.set_origin(Vector3(-0.7+0.0*i,3.5+4.1*i,0))
|
||||
t.rotate_basis(Vector3(1,0,0),Math.PI/4*i)
|
||||
|
||||
local b = create_body(stype,PhysicsServer.BODY_MODE_RIGID,t);
|
||||
|
||||
}
|
||||
|
||||
create_static_plane( Plane( Vector3(0,1,0), -1) );
|
||||
|
||||
}
|
||||
|
||||
constructor() {
|
||||
PhysicsTestBase.constructor()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return TestFall
|
2531
doc/gdscript.lyx
Before Width: | Height: | Size: 9.6 KiB |
|
@ -1,12 +0,0 @@
|
|||
/*************************************************/
|
||||
/* $filename */
|
||||
/*************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/*************************************************/
|
||||
/* Source code within this file is: */
|
||||
/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */
|
||||
/* All Rights Reserved. */
|
||||
/*************************************************/
|
||||
|
||||
|
|
@ -1,459 +0,0 @@
|
|||
<html><link href="main.css" rel="stylesheet" type="text/css" /><body><table class="top_table"><tr><td class="top_table"><image src="images/logo.png" /></td><td class="top_table"><a href="index.html">Index</a></td><td class="top_table"><a href="alphabetical.html">Classes</a></td><td class="top_table"><a href="category.html">Categories</a></td><td><a href="inheritance.html">Inheritance</a></td></tr></table><hr /><div class="class"><a name="@Global Scope"><h3 class="title class_title">@Global Scope</h3></a><div class="description class_description">
|
||||
Global scope constants and variables.
|
||||
</div><br /><div class="category"><span class="category">Category: </span><a class="category_ref" href="category.html#CATEGORY_Core">Core</a></div><h4>Public Variables:</h4><div class="member_list"><li><div class="member"><a class="datatype_existing" href="Globals.html">Globals </a><span class="identifier member_name"> Globals </span><span class="member_description">
|
||||
</span></div></li><li><div class="member"><a class="datatype_existing" href="IP.html">IP </a><span class="identifier member_name"> IP </span><span class="member_description">
|
||||
</span></div></li><li><div class="member"><a class="datatype_existing" href="Geometry.html">Geometry </a><span class="identifier member_name"> Geometry </span><span class="member_description">
|
||||
</span></div></li><li><div class="member"><a class="datatype_existing" href="ResourceLoader.html">ResourceLoader </a><span class="identifier member_name"> ResourceLoader </span><span class="member_description">
|
||||
</span></div></li><li><div class="member"><a class="datatype_existing" href="ResourceSaver.html">ResourceSaver </a><span class="identifier member_name"> ResourceSaver </span><span class="member_description">
|
||||
</span></div></li><li><div class="member"><a class="datatype_existing" href="PathRemap.html">PathRemap </a><span class="identifier member_name"> PathRemap </span><span class="member_description">
|
||||
</span></div></li><li><div class="member"><a class="datatype_existing" href="OS.html">OS </a><span class="identifier member_name"> OS </span><span class="member_description">
|
||||
</span></div></li><li><div class="member"><a class="datatype_existing" href="TranslationServer.html">TranslationServer </a><span class="identifier member_name"> TranslationServer </span><span class="member_description">
|
||||
</span></div></li><li><div class="member"><a class="datatype_existing" href="TranslationServer.html">TranslationServer </a><span class="identifier member_name"> TS </span><span class="member_description">
|
||||
</span></div></li><li><div class="member"><a class="datatype_existing" href="SceneIO.html">SceneIO </a><span class="identifier member_name"> SceneIO </span><span class="member_description">
|
||||
</span></div></li><li><div class="member"><a class="datatype_existing" href="VisualServer.html">VisualServer </a><span class="identifier member_name"> VisualServer </span><span class="member_description">
|
||||
</span></div></li><li><div class="member"><a class="datatype_existing" href="VisualServer.html">VisualServer </a><span class="identifier member_name"> VS </span><span class="member_description">
|
||||
</span></div></li><li><div class="member"><a class="datatype_existing" href="AudioServer.html">AudioServer </a><span class="identifier member_name"> AudioServer </span><span class="member_description">
|
||||
</span></div></li><li><div class="member"><a class="datatype_existing" href="AudioServer.html">AudioServer </a><span class="identifier member_name"> AS </span><span class="member_description">
|
||||
</span></div></li><li><div class="member"><a class="datatype_existing" href="PhysicsServer.html">PhysicsServer </a><span class="identifier member_name"> PhysicsServer </span><span class="member_description">
|
||||
</span></div></li><li><div class="member"><a class="datatype_existing" href="PhysicsServer.html">PhysicsServer </a><span class="identifier member_name"> PS </span><span class="member_description">
|
||||
</span></div></li><li><div class="member"><a class="datatype_existing" href="Physics2DServer.html">Physics2DServer </a><span class="identifier member_name"> Physics2DServer </span><span class="member_description">
|
||||
</span></div></li><li><div class="member"><a class="datatype_existing" href="Physics2DServer.html">Physics2DServer </a><span class="identifier member_name"> PS2D </span><span class="member_description">
|
||||
</span></div></li><li><div class="member"><a class="datatype_existing" href="SpatialSound2DServer.html">SpatialSound2DServer </a><span class="identifier member_name"> SpatialSoundServer </span><span class="member_description">
|
||||
</span></div></li><li><div class="member"><a class="datatype_existing" href="SpatialSound2DServer.html">SpatialSound2DServer </a><span class="identifier member_name"> SS </span><span class="member_description">
|
||||
</span></div></li><li><div class="member"><a class="datatype_existing" href="SpatialSound2DServer.html">SpatialSound2DServer </a><span class="identifier member_name"> SpatialSound2DServer </span><span class="member_description">
|
||||
</span></div></li><li><div class="member"><a class="datatype_existing" href="SpatialSound2DServer.html">SpatialSound2DServer </a><span class="identifier member_name"> SS2D </span><span class="member_description">
|
||||
</span></div></li></div><h4>Constants:</h4><div class="constant_list"><li><div class="constant"><span class="identifier constant_name">MARGIN_LEFT </span><span class="symbol">= </span><span class="constant_value">0 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">MARGIN_TOP </span><span class="symbol">= </span><span class="constant_value">1 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">MARGIN_RIGHT </span><span class="symbol">= </span><span class="constant_value">2 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">MARGIN_BOTTOM </span><span class="symbol">= </span><span class="constant_value">3 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">VERTICAL </span><span class="symbol">= </span><span class="constant_value">1 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">HORIZONTAL </span><span class="symbol">= </span><span class="constant_value">0 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">HALIGN_LEFT </span><span class="symbol">= </span><span class="constant_value">0 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">HALIGN_CENTER </span><span class="symbol">= </span><span class="constant_value">1 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">HALIGN_RIGHT </span><span class="symbol">= </span><span class="constant_value">2 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">VALIGN_TOP </span><span class="symbol">= </span><span class="constant_value">0 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">VALIGN_CENTER </span><span class="symbol">= </span><span class="constant_value">1 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">VALIGN_BOTTOM </span><span class="symbol">= </span><span class="constant_value">2 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">SPKEY </span><span class="symbol">= </span><span class="constant_value">16777216 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_ESCAPE </span><span class="symbol">= </span><span class="constant_value">16777217 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_TAB </span><span class="symbol">= </span><span class="constant_value">16777218 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_BACKTAB </span><span class="symbol">= </span><span class="constant_value">16777219 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_BACKSPACE </span><span class="symbol">= </span><span class="constant_value">16777220 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_RETURN </span><span class="symbol">= </span><span class="constant_value">16777221 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_ENTER </span><span class="symbol">= </span><span class="constant_value">16777222 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_INSERT </span><span class="symbol">= </span><span class="constant_value">16777223 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_DELETE </span><span class="symbol">= </span><span class="constant_value">16777224 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_PAUSE </span><span class="symbol">= </span><span class="constant_value">16777225 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_PRINT </span><span class="symbol">= </span><span class="constant_value">16777226 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_SYSREQ </span><span class="symbol">= </span><span class="constant_value">16777227 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_CLEAR </span><span class="symbol">= </span><span class="constant_value">16777228 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_HOME </span><span class="symbol">= </span><span class="constant_value">16777229 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_END </span><span class="symbol">= </span><span class="constant_value">16777230 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_LEFT </span><span class="symbol">= </span><span class="constant_value">16777231 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_UP </span><span class="symbol">= </span><span class="constant_value">16777232 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_RIGHT </span><span class="symbol">= </span><span class="constant_value">16777233 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_DOWN </span><span class="symbol">= </span><span class="constant_value">16777234 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_PAGEUP </span><span class="symbol">= </span><span class="constant_value">16777235 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_PAGEDOWN </span><span class="symbol">= </span><span class="constant_value">16777236 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_SHIFT </span><span class="symbol">= </span><span class="constant_value">16777237 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_CONTROL </span><span class="symbol">= </span><span class="constant_value">16777238 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_META </span><span class="symbol">= </span><span class="constant_value">16777239 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_ALT </span><span class="symbol">= </span><span class="constant_value">16777240 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_CAPSLOCK </span><span class="symbol">= </span><span class="constant_value">16777241 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_NUMLOCK </span><span class="symbol">= </span><span class="constant_value">16777242 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_SCROLLLOCK </span><span class="symbol">= </span><span class="constant_value">16777243 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_F1 </span><span class="symbol">= </span><span class="constant_value">16777244 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_F2 </span><span class="symbol">= </span><span class="constant_value">16777245 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_F3 </span><span class="symbol">= </span><span class="constant_value">16777246 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_F4 </span><span class="symbol">= </span><span class="constant_value">16777247 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_F5 </span><span class="symbol">= </span><span class="constant_value">16777248 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_F6 </span><span class="symbol">= </span><span class="constant_value">16777249 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_F7 </span><span class="symbol">= </span><span class="constant_value">16777250 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_F8 </span><span class="symbol">= </span><span class="constant_value">16777251 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_F9 </span><span class="symbol">= </span><span class="constant_value">16777252 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_F10 </span><span class="symbol">= </span><span class="constant_value">16777253 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_F11 </span><span class="symbol">= </span><span class="constant_value">16777254 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_F12 </span><span class="symbol">= </span><span class="constant_value">16777255 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_F13 </span><span class="symbol">= </span><span class="constant_value">16777256 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_F14 </span><span class="symbol">= </span><span class="constant_value">16777257 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_F15 </span><span class="symbol">= </span><span class="constant_value">16777258 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_F16 </span><span class="symbol">= </span><span class="constant_value">16777259 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_KP_ENTER </span><span class="symbol">= </span><span class="constant_value">16777344 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_KP_MULTIPLY </span><span class="symbol">= </span><span class="constant_value">16777345 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_KP_DIVIDE </span><span class="symbol">= </span><span class="constant_value">16777346 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_KP_SUBSTRACT </span><span class="symbol">= </span><span class="constant_value">16777347 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_KP_PERIOD </span><span class="symbol">= </span><span class="constant_value">16777348 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_KP_ADD </span><span class="symbol">= </span><span class="constant_value">16777349 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_KP_0 </span><span class="symbol">= </span><span class="constant_value">16777350 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_KP_1 </span><span class="symbol">= </span><span class="constant_value">16777351 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_KP_2 </span><span class="symbol">= </span><span class="constant_value">16777352 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_KP_3 </span><span class="symbol">= </span><span class="constant_value">16777353 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_KP_4 </span><span class="symbol">= </span><span class="constant_value">16777354 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_KP_5 </span><span class="symbol">= </span><span class="constant_value">16777355 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_KP_6 </span><span class="symbol">= </span><span class="constant_value">16777356 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_KP_7 </span><span class="symbol">= </span><span class="constant_value">16777357 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_KP_8 </span><span class="symbol">= </span><span class="constant_value">16777358 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_KP_9 </span><span class="symbol">= </span><span class="constant_value">16777359 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_SUPER_L </span><span class="symbol">= </span><span class="constant_value">16777260 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_SUPER_R </span><span class="symbol">= </span><span class="constant_value">16777261 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_MENU </span><span class="symbol">= </span><span class="constant_value">16777262 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_HYPER_L </span><span class="symbol">= </span><span class="constant_value">16777263 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_HYPER_R </span><span class="symbol">= </span><span class="constant_value">16777264 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_HELP </span><span class="symbol">= </span><span class="constant_value">16777265 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_DIRECTION_L </span><span class="symbol">= </span><span class="constant_value">16777266 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_DIRECTION_R </span><span class="symbol">= </span><span class="constant_value">16777267 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_BACK </span><span class="symbol">= </span><span class="constant_value">16777280 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_FORWARD </span><span class="symbol">= </span><span class="constant_value">16777281 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_STOP </span><span class="symbol">= </span><span class="constant_value">16777282 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_REFRESH </span><span class="symbol">= </span><span class="constant_value">16777283 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_VOLUMEDOWN </span><span class="symbol">= </span><span class="constant_value">16777284 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_VOLUMEMUTE </span><span class="symbol">= </span><span class="constant_value">16777285 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_VOLUMEUP </span><span class="symbol">= </span><span class="constant_value">16777286 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_BASSBOOST </span><span class="symbol">= </span><span class="constant_value">16777287 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_BASSUP </span><span class="symbol">= </span><span class="constant_value">16777288 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_BASSDOWN </span><span class="symbol">= </span><span class="constant_value">16777289 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_TREBLEUP </span><span class="symbol">= </span><span class="constant_value">16777290 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_TREBLEDOWN </span><span class="symbol">= </span><span class="constant_value">16777291 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_MEDIAPLAY </span><span class="symbol">= </span><span class="constant_value">16777292 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_MEDIASTOP </span><span class="symbol">= </span><span class="constant_value">16777293 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_MEDIAPREVIOUS </span><span class="symbol">= </span><span class="constant_value">16777294 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_MEDIANEXT </span><span class="symbol">= </span><span class="constant_value">16777295 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_MEDIARECORD </span><span class="symbol">= </span><span class="constant_value">16777296 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_HOMEPAGE </span><span class="symbol">= </span><span class="constant_value">16777297 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_FAVORITES </span><span class="symbol">= </span><span class="constant_value">16777298 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_SEARCH </span><span class="symbol">= </span><span class="constant_value">16777299 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_STANDBY </span><span class="symbol">= </span><span class="constant_value">16777300 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_OPENURL </span><span class="symbol">= </span><span class="constant_value">16777301 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_LAUNCHMAIL </span><span class="symbol">= </span><span class="constant_value">16777302 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_LAUNCHMEDIA </span><span class="symbol">= </span><span class="constant_value">16777303 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_LAUNCH0 </span><span class="symbol">= </span><span class="constant_value">16777304 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_LAUNCH1 </span><span class="symbol">= </span><span class="constant_value">16777305 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_LAUNCH2 </span><span class="symbol">= </span><span class="constant_value">16777306 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_LAUNCH3 </span><span class="symbol">= </span><span class="constant_value">16777307 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_LAUNCH4 </span><span class="symbol">= </span><span class="constant_value">16777308 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_LAUNCH5 </span><span class="symbol">= </span><span class="constant_value">16777309 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_LAUNCH6 </span><span class="symbol">= </span><span class="constant_value">16777310 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_LAUNCH7 </span><span class="symbol">= </span><span class="constant_value">16777311 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_LAUNCH8 </span><span class="symbol">= </span><span class="constant_value">16777312 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_LAUNCH9 </span><span class="symbol">= </span><span class="constant_value">16777313 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_LAUNCHA </span><span class="symbol">= </span><span class="constant_value">16777314 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_LAUNCHB </span><span class="symbol">= </span><span class="constant_value">16777315 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_LAUNCHC </span><span class="symbol">= </span><span class="constant_value">16777316 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_LAUNCHD </span><span class="symbol">= </span><span class="constant_value">16777317 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_LAUNCHE </span><span class="symbol">= </span><span class="constant_value">16777318 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_LAUNCHF </span><span class="symbol">= </span><span class="constant_value">16777319 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_UNKNOWN </span><span class="symbol">= </span><span class="constant_value">33554431 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_SPACE </span><span class="symbol">= </span><span class="constant_value">32 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_EXCLAM </span><span class="symbol">= </span><span class="constant_value">33 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_QUOTEDBL </span><span class="symbol">= </span><span class="constant_value">34 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_NUMBERSIGN </span><span class="symbol">= </span><span class="constant_value">35 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_DOLLAR </span><span class="symbol">= </span><span class="constant_value">36 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_PERCENT </span><span class="symbol">= </span><span class="constant_value">37 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_AMPERSAND </span><span class="symbol">= </span><span class="constant_value">38 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_APOSTROPHE </span><span class="symbol">= </span><span class="constant_value">39 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_PARENLEFT </span><span class="symbol">= </span><span class="constant_value">40 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_PARENRIGHT </span><span class="symbol">= </span><span class="constant_value">41 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_ASTERISK </span><span class="symbol">= </span><span class="constant_value">42 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_PLUS </span><span class="symbol">= </span><span class="constant_value">43 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_COMMA </span><span class="symbol">= </span><span class="constant_value">44 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_MINUS </span><span class="symbol">= </span><span class="constant_value">45 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_PERIOD </span><span class="symbol">= </span><span class="constant_value">46 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_SLASH </span><span class="symbol">= </span><span class="constant_value">47 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_0 </span><span class="symbol">= </span><span class="constant_value">48 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_1 </span><span class="symbol">= </span><span class="constant_value">49 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_2 </span><span class="symbol">= </span><span class="constant_value">50 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_3 </span><span class="symbol">= </span><span class="constant_value">51 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_4 </span><span class="symbol">= </span><span class="constant_value">52 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_5 </span><span class="symbol">= </span><span class="constant_value">53 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_6 </span><span class="symbol">= </span><span class="constant_value">54 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_7 </span><span class="symbol">= </span><span class="constant_value">55 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_8 </span><span class="symbol">= </span><span class="constant_value">56 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_9 </span><span class="symbol">= </span><span class="constant_value">57 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_COLON </span><span class="symbol">= </span><span class="constant_value">58 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_SEMICOLON </span><span class="symbol">= </span><span class="constant_value">59 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_LESS </span><span class="symbol">= </span><span class="constant_value">60 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_EQUAL </span><span class="symbol">= </span><span class="constant_value">61 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_GREATER </span><span class="symbol">= </span><span class="constant_value">62 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_QUESTION </span><span class="symbol">= </span><span class="constant_value">63 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_AT </span><span class="symbol">= </span><span class="constant_value">64 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_A </span><span class="symbol">= </span><span class="constant_value">65 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_B </span><span class="symbol">= </span><span class="constant_value">66 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_C </span><span class="symbol">= </span><span class="constant_value">67 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_D </span><span class="symbol">= </span><span class="constant_value">68 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_E </span><span class="symbol">= </span><span class="constant_value">69 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_F </span><span class="symbol">= </span><span class="constant_value">70 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_G </span><span class="symbol">= </span><span class="constant_value">71 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_H </span><span class="symbol">= </span><span class="constant_value">72 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_I </span><span class="symbol">= </span><span class="constant_value">73 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_J </span><span class="symbol">= </span><span class="constant_value">74 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_K </span><span class="symbol">= </span><span class="constant_value">75 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_L </span><span class="symbol">= </span><span class="constant_value">76 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_M </span><span class="symbol">= </span><span class="constant_value">77 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_N </span><span class="symbol">= </span><span class="constant_value">78 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_O </span><span class="symbol">= </span><span class="constant_value">79 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_P </span><span class="symbol">= </span><span class="constant_value">80 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_Q </span><span class="symbol">= </span><span class="constant_value">81 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_R </span><span class="symbol">= </span><span class="constant_value">82 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_S </span><span class="symbol">= </span><span class="constant_value">83 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_T </span><span class="symbol">= </span><span class="constant_value">84 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_U </span><span class="symbol">= </span><span class="constant_value">85 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_V </span><span class="symbol">= </span><span class="constant_value">86 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_W </span><span class="symbol">= </span><span class="constant_value">87 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_X </span><span class="symbol">= </span><span class="constant_value">88 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_Y </span><span class="symbol">= </span><span class="constant_value">89 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_Z </span><span class="symbol">= </span><span class="constant_value">90 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_BRACKETLEFT </span><span class="symbol">= </span><span class="constant_value">91 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_BACKSLASH </span><span class="symbol">= </span><span class="constant_value">92 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_BRACKETRIGHT </span><span class="symbol">= </span><span class="constant_value">93 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_ASCIICIRCUM </span><span class="symbol">= </span><span class="constant_value">94 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_UNDERSCORE </span><span class="symbol">= </span><span class="constant_value">95 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_QUOTELEFT </span><span class="symbol">= </span><span class="constant_value">96 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_BRACELEFT </span><span class="symbol">= </span><span class="constant_value">123 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_BAR </span><span class="symbol">= </span><span class="constant_value">124 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_BRACERIGHT </span><span class="symbol">= </span><span class="constant_value">125 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_ASCIITILDE </span><span class="symbol">= </span><span class="constant_value">126 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_NOBREAKSPACE </span><span class="symbol">= </span><span class="constant_value">160 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_EXCLAMDOWN </span><span class="symbol">= </span><span class="constant_value">161 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_CENT </span><span class="symbol">= </span><span class="constant_value">162 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_STERLING </span><span class="symbol">= </span><span class="constant_value">163 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_CURRENCY </span><span class="symbol">= </span><span class="constant_value">164 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_YEN </span><span class="symbol">= </span><span class="constant_value">165 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_BROKENBAR </span><span class="symbol">= </span><span class="constant_value">166 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_SECTION </span><span class="symbol">= </span><span class="constant_value">167 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_DIAERESIS </span><span class="symbol">= </span><span class="constant_value">168 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_COPYRIGHT </span><span class="symbol">= </span><span class="constant_value">169 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_ORDFEMININE </span><span class="symbol">= </span><span class="constant_value">170 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_GUILLEMOTLEFT </span><span class="symbol">= </span><span class="constant_value">171 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_NOTSIGN </span><span class="symbol">= </span><span class="constant_value">172 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_HYPHEN </span><span class="symbol">= </span><span class="constant_value">173 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_REGISTERED </span><span class="symbol">= </span><span class="constant_value">174 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_MACRON </span><span class="symbol">= </span><span class="constant_value">175 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_DEGREE </span><span class="symbol">= </span><span class="constant_value">176 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_PLUSMINUS </span><span class="symbol">= </span><span class="constant_value">177 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_TWOSUPERIOR </span><span class="symbol">= </span><span class="constant_value">178 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_THREESUPERIOR </span><span class="symbol">= </span><span class="constant_value">179 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_ACUTE </span><span class="symbol">= </span><span class="constant_value">180 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_MU </span><span class="symbol">= </span><span class="constant_value">181 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_PARAGRAPH </span><span class="symbol">= </span><span class="constant_value">182 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_PERIODCENTERED </span><span class="symbol">= </span><span class="constant_value">183 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_CEDILLA </span><span class="symbol">= </span><span class="constant_value">184 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_ONESUPERIOR </span><span class="symbol">= </span><span class="constant_value">185 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_MASCULINE </span><span class="symbol">= </span><span class="constant_value">186 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_GUILLEMOTRIGHT </span><span class="symbol">= </span><span class="constant_value">187 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_ONEQUARTER </span><span class="symbol">= </span><span class="constant_value">188 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_ONEHALF </span><span class="symbol">= </span><span class="constant_value">189 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_THREEQUARTERS </span><span class="symbol">= </span><span class="constant_value">190 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_QUESTIONDOWN </span><span class="symbol">= </span><span class="constant_value">191 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_AGRAVE </span><span class="symbol">= </span><span class="constant_value">192 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_AACUTE </span><span class="symbol">= </span><span class="constant_value">193 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_ACIRCUMFLEX </span><span class="symbol">= </span><span class="constant_value">194 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_ATILDE </span><span class="symbol">= </span><span class="constant_value">195 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_ADIAERESIS </span><span class="symbol">= </span><span class="constant_value">196 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_ARING </span><span class="symbol">= </span><span class="constant_value">197 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_AE </span><span class="symbol">= </span><span class="constant_value">198 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_CCEDILLA </span><span class="symbol">= </span><span class="constant_value">199 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_EGRAVE </span><span class="symbol">= </span><span class="constant_value">200 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_EACUTE </span><span class="symbol">= </span><span class="constant_value">201 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_ECIRCUMFLEX </span><span class="symbol">= </span><span class="constant_value">202 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_EDIAERESIS </span><span class="symbol">= </span><span class="constant_value">203 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_IGRAVE </span><span class="symbol">= </span><span class="constant_value">204 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_IACUTE </span><span class="symbol">= </span><span class="constant_value">205 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_ICIRCUMFLEX </span><span class="symbol">= </span><span class="constant_value">206 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_IDIAERESIS </span><span class="symbol">= </span><span class="constant_value">207 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_ETH </span><span class="symbol">= </span><span class="constant_value">208 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_NTILDE </span><span class="symbol">= </span><span class="constant_value">209 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_OGRAVE </span><span class="symbol">= </span><span class="constant_value">210 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_OACUTE </span><span class="symbol">= </span><span class="constant_value">211 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_OCIRCUMFLEX </span><span class="symbol">= </span><span class="constant_value">212 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_OTILDE </span><span class="symbol">= </span><span class="constant_value">213 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_ODIAERESIS </span><span class="symbol">= </span><span class="constant_value">214 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_MULTIPLY </span><span class="symbol">= </span><span class="constant_value">215 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_OOBLIQUE </span><span class="symbol">= </span><span class="constant_value">216 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_UGRAVE </span><span class="symbol">= </span><span class="constant_value">217 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_UACUTE </span><span class="symbol">= </span><span class="constant_value">218 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_UCIRCUMFLEX </span><span class="symbol">= </span><span class="constant_value">219 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_UDIAERESIS </span><span class="symbol">= </span><span class="constant_value">220 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_YACUTE </span><span class="symbol">= </span><span class="constant_value">221 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_THORN </span><span class="symbol">= </span><span class="constant_value">222 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_SSHARP </span><span class="symbol">= </span><span class="constant_value">223 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_DIVISION </span><span class="symbol">= </span><span class="constant_value">247 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_YDIAERESIS </span><span class="symbol">= </span><span class="constant_value">255 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_CODE_MASK </span><span class="symbol">= </span><span class="constant_value">33554431 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_MODIFIER_MASK </span><span class="symbol">= </span><span class="constant_value">-16777216 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_MASK_SHIFT </span><span class="symbol">= </span><span class="constant_value">33554432 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_MASK_ALT </span><span class="symbol">= </span><span class="constant_value">67108864 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_MASK_META </span><span class="symbol">= </span><span class="constant_value">134217728 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_MASK_CTRL </span><span class="symbol">= </span><span class="constant_value">268435456 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_MASK_KPAD </span><span class="symbol">= </span><span class="constant_value">536870912 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">KEY_MASK_GROUP_SWITCH </span><span class="symbol">= </span><span class="constant_value">1073741824 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">BUTTON_LEFT </span><span class="symbol">= </span><span class="constant_value">1 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">BUTTON_RIGHT </span><span class="symbol">= </span><span class="constant_value">2 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">BUTTON_MIDDLE </span><span class="symbol">= </span><span class="constant_value">3 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">BUTTON_WHEEL_UP </span><span class="symbol">= </span><span class="constant_value">4 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">BUTTON_WHEEL_DOWN </span><span class="symbol">= </span><span class="constant_value">5 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">BUTTON_MASK_LEFT </span><span class="symbol">= </span><span class="constant_value">1 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">BUTTON_MASK_RIGHT </span><span class="symbol">= </span><span class="constant_value">2 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">BUTTON_MASK_MIDDLE </span><span class="symbol">= </span><span class="constant_value">4 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_BUTTON_0 </span><span class="symbol">= </span><span class="constant_value">0 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_BUTTON_1 </span><span class="symbol">= </span><span class="constant_value">1 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_BUTTON_2 </span><span class="symbol">= </span><span class="constant_value">2 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_BUTTON_3 </span><span class="symbol">= </span><span class="constant_value">3 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_BUTTON_4 </span><span class="symbol">= </span><span class="constant_value">4 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_BUTTON_5 </span><span class="symbol">= </span><span class="constant_value">5 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_BUTTON_6 </span><span class="symbol">= </span><span class="constant_value">6 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_BUTTON_7 </span><span class="symbol">= </span><span class="constant_value">7 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_BUTTON_8 </span><span class="symbol">= </span><span class="constant_value">8 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_BUTTON_9 </span><span class="symbol">= </span><span class="constant_value">9 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_BUTTON_10 </span><span class="symbol">= </span><span class="constant_value">10 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_BUTTON_11 </span><span class="symbol">= </span><span class="constant_value">11 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_BUTTON_12 </span><span class="symbol">= </span><span class="constant_value">12 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_BUTTON_13 </span><span class="symbol">= </span><span class="constant_value">13 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_BUTTON_14 </span><span class="symbol">= </span><span class="constant_value">14 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_BUTTON_15 </span><span class="symbol">= </span><span class="constant_value">15 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_BUTTON_MAX </span><span class="symbol">= </span><span class="constant_value">16 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_SNES_A </span><span class="symbol">= </span><span class="constant_value">1 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_SNES_B </span><span class="symbol">= </span><span class="constant_value">0 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_SNES_X </span><span class="symbol">= </span><span class="constant_value">3 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_SNES_Y </span><span class="symbol">= </span><span class="constant_value">2 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_SONY_CIRCLE </span><span class="symbol">= </span><span class="constant_value">1 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_SONY_X </span><span class="symbol">= </span><span class="constant_value">0 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_SONY_SQUARE </span><span class="symbol">= </span><span class="constant_value">2 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_SONY_TRIANGLE </span><span class="symbol">= </span><span class="constant_value">3 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_SEGA_B </span><span class="symbol">= </span><span class="constant_value">1 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_SEGA_A </span><span class="symbol">= </span><span class="constant_value">0 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_SEGA_X </span><span class="symbol">= </span><span class="constant_value">2 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_SEGA_Y </span><span class="symbol">= </span><span class="constant_value">3 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_XBOX_B </span><span class="symbol">= </span><span class="constant_value">1 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_XBOX_A </span><span class="symbol">= </span><span class="constant_value">0 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_XBOX_X </span><span class="symbol">= </span><span class="constant_value">2 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_XBOX_Y </span><span class="symbol">= </span><span class="constant_value">3 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_DS_A </span><span class="symbol">= </span><span class="constant_value">1 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_DS_B </span><span class="symbol">= </span><span class="constant_value">0 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_DS_X </span><span class="symbol">= </span><span class="constant_value">3 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_DS_Y </span><span class="symbol">= </span><span class="constant_value">2 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_SELECT </span><span class="symbol">= </span><span class="constant_value">10 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_START </span><span class="symbol">= </span><span class="constant_value">11 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_DPAD_UP </span><span class="symbol">= </span><span class="constant_value">12 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_DPAD_DOWN </span><span class="symbol">= </span><span class="constant_value">13 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_DPAD_LEFT </span><span class="symbol">= </span><span class="constant_value">14 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_DPAD_RIGHT </span><span class="symbol">= </span><span class="constant_value">15 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_L </span><span class="symbol">= </span><span class="constant_value">4 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_L2 </span><span class="symbol">= </span><span class="constant_value">6 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_L3 </span><span class="symbol">= </span><span class="constant_value">8 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_R </span><span class="symbol">= </span><span class="constant_value">5 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_R2 </span><span class="symbol">= </span><span class="constant_value">7 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_R3 </span><span class="symbol">= </span><span class="constant_value">9 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_AXIS_0 </span><span class="symbol">= </span><span class="constant_value">0 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_AXIS_1 </span><span class="symbol">= </span><span class="constant_value">1 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_AXIS_2 </span><span class="symbol">= </span><span class="constant_value">2 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_AXIS_3 </span><span class="symbol">= </span><span class="constant_value">3 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_AXIS_4 </span><span class="symbol">= </span><span class="constant_value">4 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_AXIS_5 </span><span class="symbol">= </span><span class="constant_value">5 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_AXIS_6 </span><span class="symbol">= </span><span class="constant_value">6 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_AXIS_7 </span><span class="symbol">= </span><span class="constant_value">7 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_AXIS_MAX </span><span class="symbol">= </span><span class="constant_value">8 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_ANALOG_0_X </span><span class="symbol">= </span><span class="constant_value">0 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_ANALOG_0_Y </span><span class="symbol">= </span><span class="constant_value">1 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_ANALOG_1_X </span><span class="symbol">= </span><span class="constant_value">2 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_ANALOG_1_Y </span><span class="symbol">= </span><span class="constant_value">3 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_ANALOG_2_X </span><span class="symbol">= </span><span class="constant_value">4 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">JOY_ANALOG_2_Y </span><span class="symbol">= </span><span class="constant_value">5 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">OK </span><span class="symbol">= </span><span class="constant_value">0 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">FAILED </span><span class="symbol">= </span><span class="constant_value">1 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_UNAVAILABLE </span><span class="symbol">= </span><span class="constant_value">2 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_UNCONFIGURED </span><span class="symbol">= </span><span class="constant_value">3 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_UNAUTHORIZED </span><span class="symbol">= </span><span class="constant_value">4 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_PARAMETER_RANGE_ERROR </span><span class="symbol">= </span><span class="constant_value">5 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_OUT_OF_MEMORY </span><span class="symbol">= </span><span class="constant_value">6 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_FILE_NOT_FOUND </span><span class="symbol">= </span><span class="constant_value">7 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_FILE_BAD_DRIVE </span><span class="symbol">= </span><span class="constant_value">8 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_FILE_BAD_PATH </span><span class="symbol">= </span><span class="constant_value">9 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_FILE_NO_PERMISSION </span><span class="symbol">= </span><span class="constant_value">10 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_FILE_ALREADY_IN_USE </span><span class="symbol">= </span><span class="constant_value">11 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_FILE_CANT_OPEN </span><span class="symbol">= </span><span class="constant_value">12 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_FILE_CANT_WRITE </span><span class="symbol">= </span><span class="constant_value">13 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_FILE_CANT_READ </span><span class="symbol">= </span><span class="constant_value">14 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_FILE_UNRECOGNIZED </span><span class="symbol">= </span><span class="constant_value">15 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_FILE_CORRUPT </span><span class="symbol">= </span><span class="constant_value">16 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_FILE_EOF </span><span class="symbol">= </span><span class="constant_value">17 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_CANT_OPEN </span><span class="symbol">= </span><span class="constant_value">18 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_CANT_CREATE </span><span class="symbol">= </span><span class="constant_value">19 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERROR_QUERY_FAILED </span><span class="symbol">= </span><span class="constant_value">20 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_ALREADY_IN_USE </span><span class="symbol">= </span><span class="constant_value">21 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_LOCKED </span><span class="symbol">= </span><span class="constant_value">22 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_TIMEOUT </span><span class="symbol">= </span><span class="constant_value">23 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_CANT_AQUIRE_RESOURCE </span><span class="symbol">= </span><span class="constant_value">24 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_INVALID_DATA </span><span class="symbol">= </span><span class="constant_value">26 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_INVALID_PARAMETER </span><span class="symbol">= </span><span class="constant_value">27 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_ALREADY_EXISTS </span><span class="symbol">= </span><span class="constant_value">28 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_DOES_NOT_EXIST </span><span class="symbol">= </span><span class="constant_value">29 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_DATABASE_CANT_READ </span><span class="symbol">= </span><span class="constant_value">30 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_DATABASE_CANT_WRITE </span><span class="symbol">= </span><span class="constant_value">31 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_COMPILATION_FAILED </span><span class="symbol">= </span><span class="constant_value">32 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_METHOD_NOT_FOUND </span><span class="symbol">= </span><span class="constant_value">33 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_LINK_FAILED </span><span class="symbol">= </span><span class="constant_value">34 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_SCRIPT_FAILED </span><span class="symbol">= </span><span class="constant_value">35 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_CYCLIC_LINK </span><span class="symbol">= </span><span class="constant_value">36 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_BUSY </span><span class="symbol">= </span><span class="constant_value">40 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_HELP </span><span class="symbol">= </span><span class="constant_value">42 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_BUG </span><span class="symbol">= </span><span class="constant_value">43 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">ERR_WTF </span><span class="symbol">= </span><span class="constant_value">45 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">PROPERTY_HINT_NONE </span><span class="symbol">= </span><span class="constant_value">0 </span><span class="constant_description">
|
||||
No hint for edited property.
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">PROPERTY_HINT_RANGE </span><span class="symbol">= </span><span class="constant_value">1 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">PROPERTY_HINT_EXP_RANGE </span><span class="symbol">= </span><span class="constant_value">2 </span><span class="constant_description">
|
||||
Hint string is an exponential range, defined as "min,max" or "min,max,step". This is valid for integers and floats.
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">PROPERTY_HINT_ENUM </span><span class="symbol">= </span><span class="constant_value">3 </span><span class="constant_description">
|
||||
Property hint is an enumerated value, like "Hello,Something,Else". This is valid for integers, floats and strings properties.
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">PROPERTY_HINT_LENGTH </span><span class="symbol">= </span><span class="constant_value">5 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">PROPERTY_HINT_FLAGS </span><span class="symbol">= </span><span class="constant_value">7 </span><span class="constant_description">
|
||||
Property hint is a bitmask description, for bits 0,1,2,3 abd 5 the hint would be like "Bit0,Bit1,Bit2,Bit3,,Bit5". Valid only for integers.
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">PROPERTY_HINT_FILE </span><span class="symbol">= </span><span class="constant_value">8 </span><span class="constant_description">
|
||||
String property is a file (so pop up a file dialog when edited). Hint string can be a set of wildcards like "*.doc".
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">PROPERTY_HINT_DIR </span><span class="symbol">= </span><span class="constant_value">9 </span><span class="constant_description">
|
||||
String property is a directory (so pop up a file dialog when edited).
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">PROPERTY_HINT_RESOURCE_TYPE </span><span class="symbol">= </span><span class="constant_value">10 </span><span class="constant_description">
|
||||
String property is a resource, so open the resource popup menu when edited.
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">PROPERTY_USAGE_STORAGE </span><span class="symbol">= </span><span class="constant_value">1 </span><span class="constant_description">
|
||||
Property will be used as storage (default).
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">PROPERTY_USAGE_STORAGE </span><span class="symbol">= </span><span class="constant_value">1 </span><span class="constant_description">
|
||||
Property will be used as storage (default).
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">PROPERTY_USAGE_EDITOR </span><span class="symbol">= </span><span class="constant_value">2 </span><span class="constant_description">
|
||||
Property will be visible in editor (default).
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">PROPERTY_USAGE_NETWORK </span><span class="symbol">= </span><span class="constant_value">4 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">PROPERTY_USAGE_DEFAULT </span><span class="symbol">= </span><span class="constant_value">7 </span><span class="constant_description">
|
||||
Default usage (storage and editor).
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_NIL </span><span class="symbol">= </span><span class="constant_value">0 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_BOOL </span><span class="symbol">= </span><span class="constant_value">1 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_INT </span><span class="symbol">= </span><span class="constant_value">2 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_REAL </span><span class="symbol">= </span><span class="constant_value">3 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_STRING </span><span class="symbol">= </span><span class="constant_value">4 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_VECTOR2 </span><span class="symbol">= </span><span class="constant_value">5 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_RECT2 </span><span class="symbol">= </span><span class="constant_value">6 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_VECTOR3 </span><span class="symbol">= </span><span class="constant_value">7 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_MATRIX32 </span><span class="symbol">= </span><span class="constant_value">8 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_PLANE </span><span class="symbol">= </span><span class="constant_value">9 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_QUAT </span><span class="symbol">= </span><span class="constant_value">10 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_AABB </span><span class="symbol">= </span><span class="constant_value">11 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_MATRIX3 </span><span class="symbol">= </span><span class="constant_value">12 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_TRANSFORM </span><span class="symbol">= </span><span class="constant_value">13 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_COLOR </span><span class="symbol">= </span><span class="constant_value">14 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_IMAGE </span><span class="symbol">= </span><span class="constant_value">15 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_NODE_PATH </span><span class="symbol">= </span><span class="constant_value">16 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_RID </span><span class="symbol">= </span><span class="constant_value">17 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_OBJECT </span><span class="symbol">= </span><span class="constant_value">18 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_INPUT_EVENT </span><span class="symbol">= </span><span class="constant_value">19 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_DICTIONARY </span><span class="symbol">= </span><span class="constant_value">20 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_ARRAY </span><span class="symbol">= </span><span class="constant_value">21 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_RAW_ARRAY </span><span class="symbol">= </span><span class="constant_value">22 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_INT_ARRAY </span><span class="symbol">= </span><span class="constant_value">23 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_REAL_ARRAY </span><span class="symbol">= </span><span class="constant_value">24 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_STRING_ARRAY </span><span class="symbol">= </span><span class="constant_value">25 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_VECTOR2_ARRAY </span><span class="symbol">= </span><span class="constant_value">26 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_VECTOR3_ARRAY </span><span class="symbol">= </span><span class="constant_value">27 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_COLOR_ARRAY </span><span class="symbol">= </span><span class="constant_value">28 </span><span class="constant_description">
|
||||
</span></div></li><li><div class="constant"><span class="identifier constant_name">TYPE_MAX </span><span class="symbol">= </span><span class="constant_value">29 </span><span class="constant_description">
|
||||
</span></div></li></div><h4>Description:</h4><div class="description">
|
||||
Global scope constants and variables. This is all that resides in the globals, constants regarding error codes, scancodes, property hints, etc. It's not much.
|
||||
Singletons are also documented here, since they can be accessed from anywhere.
|
||||
</div><h4>Method Documentation:</h4></div><hr /><span>Copyright 2008-2010 Codenix SRL</span></body></html>
|
|
@ -1,2 +0,0 @@
|
|||
<html><link href="main.css" rel="stylesheet" type="text/css" /><body><table class="top_table"><tr><td class="top_table"><image src="images/logo.png" /></td><td class="top_table"><a href="index.html">Index</a></td><td class="top_table"><a href="alphabetical.html">Classes</a></td><td class="top_table"><a href="category.html">Categories</a></td><td><a href="inheritance.html">Inheritance</a></td></tr></table><hr /><div class="class"><a name="@Squirrel"><h3 class="title class_title">@Squirrel</h3></a><div class="description class_description">
|
||||
</div><br /><div class="category"><span class="category">Category: </span><a class="category_ref" href="category.html#CATEGORY_Core">Core</a></div><h4>Method Documentation:</h4></div><hr /><span>Copyright 2008-2010 Codenix SRL</span></body></html>
|
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 2.4 KiB |
|
@ -1,128 +0,0 @@
|
|||
|
||||
/* start css.sty */
|
||||
.cmr-7{font-size:70%;}
|
||||
.cmmi-7{font-size:70%;font-style: italic;}
|
||||
.cmmi-10{font-style: italic;}
|
||||
.ectt-1000{ font-family: monospace;}
|
||||
.ectt-1000{ font-family: monospace;}
|
||||
.ectt-1000{ font-family: monospace;}
|
||||
.ectt-1000{ font-family: monospace;}
|
||||
.ectt-1000{ font-family: monospace;}
|
||||
.ecti-1000{ font-style: italic;}
|
||||
.ecti-1000{ font-style: italic;}
|
||||
.ecti-1000{ font-style: italic;}
|
||||
.ecti-1000{ font-style: italic;}
|
||||
.ecti-1000{ font-style: italic;}
|
||||
.ecti-0700{font-size:70%; font-style: italic;}
|
||||
.ecti-0700{ font-style: italic;}
|
||||
.ecti-0700{ font-style: italic;}
|
||||
.ecti-0700{ font-style: italic;}
|
||||
.ecti-0700{ font-style: italic;}
|
||||
.ecrm-0700{font-size:70%;}
|
||||
p.noindent { text-indent: 0em }
|
||||
td p.noindent { text-indent: 0em; margin-top:0em; }
|
||||
p.nopar { text-indent: 0em; }
|
||||
p.indent{ text-indent: 1.5em }
|
||||
@media print {div.crosslinks {visibility:hidden;}}
|
||||
a img { border-top: 0; border-left: 0; border-right: 0; }
|
||||
center { margin-top:1em; margin-bottom:1em; }
|
||||
td center { margin-top:0em; margin-bottom:0em; }
|
||||
.Canvas { position:relative; }
|
||||
img.math{vertical-align:middle;}
|
||||
li p.indent { text-indent: 0em }
|
||||
.enumerate1 {list-style-type:decimal;}
|
||||
.enumerate2 {list-style-type:lower-alpha;}
|
||||
.enumerate3 {list-style-type:lower-roman;}
|
||||
.enumerate4 {list-style-type:upper-alpha;}
|
||||
div.newtheorem { margin-bottom: 2em; margin-top: 2em;}
|
||||
.obeylines-h,.obeylines-v {white-space: nowrap; }
|
||||
div.obeylines-v p { margin-top:0; margin-bottom:0; }
|
||||
.overline{ text-decoration:overline; }
|
||||
.overline img{ border-top: 1px solid black; }
|
||||
td.displaylines {text-align:center; white-space:nowrap;}
|
||||
.centerline {text-align:center;}
|
||||
.rightline {text-align:right;}
|
||||
div.verbatim {font-family: monospace; white-space: nowrap; text-align:left; clear:both; }
|
||||
.fbox {padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; }
|
||||
div.fbox {display:table}
|
||||
div.center div.fbox {text-align:center; clear:both; padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; }
|
||||
table.minipage{width:100%;}
|
||||
div.center, div.center div.center {text-align: center; margin-left:1em; margin-right:1em;}
|
||||
div.center div {text-align: left;}
|
||||
div.flushright, div.flushright div.flushright {text-align: right;}
|
||||
div.flushright div {text-align: left;}
|
||||
div.flushleft {text-align: left;}
|
||||
.underline{ text-decoration:underline; }
|
||||
.underline img{ border-bottom: 1px solid black; margin-bottom:1pt; }
|
||||
.framebox-c, .framebox-l, .framebox-r { padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; }
|
||||
.framebox-c {text-align:center;}
|
||||
.framebox-l {text-align:left;}
|
||||
.framebox-r {text-align:right;}
|
||||
span.thank-mark{ vertical-align: super }
|
||||
span.footnote-mark sup.textsuperscript, span.footnote-mark a sup.textsuperscript{ font-size:80%; }
|
||||
div.tabular, div.center div.tabular {text-align: center; margin-top:0.5em; margin-bottom:0.5em; }
|
||||
table.tabular td p{margin-top:0em;}
|
||||
table.tabular {margin-left: auto; margin-right: auto;}
|
||||
div.td00{ margin-left:0pt; margin-right:0pt; }
|
||||
div.td01{ margin-left:0pt; margin-right:5pt; }
|
||||
div.td10{ margin-left:5pt; margin-right:0pt; }
|
||||
div.td11{ margin-left:5pt; margin-right:5pt; }
|
||||
table[rules] {border-left:solid black 0.4pt; border-right:solid black 0.4pt; }
|
||||
td.td00{ padding-left:0pt; padding-right:0pt; }
|
||||
td.td01{ padding-left:0pt; padding-right:5pt; }
|
||||
td.td10{ padding-left:5pt; padding-right:0pt; }
|
||||
td.td11{ padding-left:5pt; padding-right:5pt; }
|
||||
table[rules] {border-left:solid black 0.4pt; border-right:solid black 0.4pt; }
|
||||
.hline hr, .cline hr{ height : 1px; margin:0px; }
|
||||
.tabbing-right {text-align:right;}
|
||||
span.TEX {letter-spacing: -0.125em; }
|
||||
span.TEX span.E{ position:relative;top:0.5ex;left:-0.0417em;}
|
||||
a span.TEX span.E {text-decoration: none; }
|
||||
span.LATEX span.A{ position:relative; top:-0.5ex; left:-0.4em; font-size:85%;}
|
||||
span.LATEX span.TEX{ position:relative; left: -0.4em; }
|
||||
div.float img, div.float .caption {text-align:center;}
|
||||
div.figure img, div.figure .caption {text-align:center;}
|
||||
.marginpar {width:20%; float:right; text-align:left; margin-left:auto; margin-top:0.5em; font-size:85%; text-decoration:underline;}
|
||||
.marginpar p{margin-top:0.4em; margin-bottom:0.4em;}
|
||||
table.equation {width:100%;}
|
||||
.equation td{text-align:center; }
|
||||
td.equation { margin-top:1em; margin-bottom:1em; }
|
||||
td.equation-label { width:5%; text-align:center; }
|
||||
td.eqnarray4 { width:5%; white-space: normal; }
|
||||
td.eqnarray2 { width:5%; }
|
||||
table.eqnarray-star, table.eqnarray {width:100%;}
|
||||
div.eqnarray{text-align:center;}
|
||||
div.array {text-align:center;}
|
||||
div.pmatrix {text-align:center;}
|
||||
table.pmatrix {width:100%;}
|
||||
span.pmatrix img{vertical-align:middle;}
|
||||
div.pmatrix {text-align:center;}
|
||||
table.pmatrix {width:100%;}
|
||||
img.cdots{vertical-align:middle;}
|
||||
.partToc a, .partToc, .likepartToc a, .likepartToc {line-height: 200%; font-weight:bold; font-size:110%;}
|
||||
.index-item, .index-subitem, .index-subsubitem {display:block}
|
||||
.caption td.id{font-weight: bold; white-space: nowrap; }
|
||||
table.caption {text-align:center;}
|
||||
h1.partHead{text-align: center}
|
||||
p.bibitem { text-indent: -2em; margin-left: 2em; margin-top:0.6em; margin-bottom:0.6em; }
|
||||
p.bibitem-p { text-indent: 0em; margin-left: 2em; margin-top:0.6em; margin-bottom:0.6em; }
|
||||
.paragraphHead, .likeparagraphHead { margin-top:2em; font-weight: bold;}
|
||||
.subparagraphHead, .likesubparagraphHead { font-weight: bold;}
|
||||
.quote {margin-bottom:0.25em; margin-top:0.25em; margin-left:1em; margin-right:1em; text-align:justify;}
|
||||
.verse{white-space:nowrap; margin-left:2em}
|
||||
div.maketitle {text-align:center;}
|
||||
h2.titleHead{text-align:center;}
|
||||
div.maketitle{ margin-bottom: 2em; }
|
||||
div.author, div.date {text-align:center;}
|
||||
div.thanks{text-align:left; margin-left:10%; font-size:85%; font-style:italic; }
|
||||
div.author{white-space: nowrap;}
|
||||
.quotation {margin-bottom:0.25em; margin-top:0.25em; margin-left:1em; }
|
||||
.abstract p {margin-left:5%; margin-right:5%;}
|
||||
table.abstract {width:100%;}
|
||||
.lstlisting .label{margin-right:0.5em; }
|
||||
div.lstlisting{font-family: monospace; white-space: nowrap; margin-top:0.5em; margin-bottom:0.5em; }
|
||||
div.lstinputlisting{ font-family: monospace; white-space: nowrap; }
|
||||
.lstinputlisting .label{margin-right:0.5em;}
|
||||
.figure img.graphics {margin-left:10%;}
|
||||
/* end css.sty */
|
||||
|
|
@ -1,902 +0,0 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html >
|
||||
<head><title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta name="generator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)">
|
||||
<meta name="originator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)">
|
||||
<!-- html -->
|
||||
<meta name="src" content="tutorial.tex">
|
||||
<meta name="date" content="2009-10-07 00:28:00">
|
||||
<link rel="stylesheet" type="text/css" href="tutorial.css">
|
||||
</head><body
|
||||
>
|
||||
<h3 class="sectionHead"><span class="titlemark">1 </span> <a
|
||||
id="x1-10001"></a>Introduction to 3D Math</h3>
|
||||
<!--l. 27--><p class="noindent" >
|
||||
<h4 class="subsectionHead"><span class="titlemark">1.1 </span> <a
|
||||
id="x1-20001.1"></a>Introduction</h4>
|
||||
<!--l. 29--><p class="noindent" >There are many approaches to understanding the type of 3D math used in video
|
||||
games, modelling, ray-tracing, etc. The usual is through vector algebra, matrices, and
|
||||
linear transformations and, while they are not completely necesary to understand
|
||||
most of the aspects of 3D game programming (from the theorical point of view), they
|
||||
provide a common language to communicate with other programmers or
|
||||
engineers.
|
||||
<!--l. 36--><p class="indent" > This tutorial will focus on explaining all the basic concepts needed for a
|
||||
programmer to understand how to develop 3D games without getting too deep into
|
||||
algebra. Instead of a math-oriented language, code examples will be given instead
|
||||
when possible. The reason for this is that. while programmers may have
|
||||
different backgrounds or experience (be it scientific, engineering or self taught),
|
||||
code is the most familiar language and the lowest common denominator for
|
||||
understanding.
|
||||
<!--l. 45--><p class="noindent" >
|
||||
<h4 class="subsectionHead"><span class="titlemark">1.2 </span> <a
|
||||
id="x1-30001.2"></a>Vectors</h4>
|
||||
<!--l. 48--><p class="noindent" >
|
||||
<h5 class="subsubsectionHead"><span class="titlemark">1.2.1 </span> <a
|
||||
id="x1-40001.2.1"></a>Brief Introduction</h5>
|
||||
<!--l. 50--><p class="noindent" >When writing 2D games, interfaces and other applications, the typical convention is
|
||||
to define coordinates as an <span
|
||||
class="ecti-1000">x,y </span>pair, <span
|
||||
class="ecti-1000">x </span>representing the horizontal offset and <span
|
||||
class="ecti-1000">y </span>the
|
||||
vertical one. In most cases, the unit for both is <span
|
||||
class="ecti-1000">pixels</span>. This makes sense given the
|
||||
screen is just a rectangle in two dimensions.
|
||||
<!--l. 56--><p class="indent" > An <span
|
||||
class="ecti-1000">x,y </span>pair can be used for two purposes. It can be an absolute position (screen
|
||||
cordinate in the previous case), or a relative direction, if we trace an arrow from the
|
||||
origin (0,0 coordinates) to it’s position.
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 60--><p class="noindent" >
|
||||
|
||||
<div class="tabular">
|
||||
<table id="TBL-1" class="tabular"
|
||||
cellspacing="0" cellpadding="0"
|
||||
><colgroup id="TBL-1-1g"><col
|
||||
id="TBL-1-1"><col
|
||||
id="TBL-1-2"><col
|
||||
id="TBL-1-3"></colgroup><tr
|
||||
style="vertical-align:baseline;" id="TBL-1-1-"><td style="white-space:nowrap; text-align:center;" id="TBL-1-1-1"
|
||||
class="td11"><img
|
||||
src="tutorial0x.png" alt="PIC" class="graphics" width="100.375pt" height="100.375pt" ><!--tex4ht:graphics
|
||||
name="tutorial0x.png" src="0_home_red_coding_godot_doc_math_position.eps"
|
||||
--></td><td style="white-space:nowrap; text-align:center;" id="TBL-1-1-2"
|
||||
class="td11"></td><td style="white-space:nowrap; text-align:center;" id="TBL-1-1-3"
|
||||
class="td11"><img
|
||||
src="tutorial1x.png" alt="PIC" class="graphics" width="100.375pt" height="100.375pt" ><!--tex4ht:graphics
|
||||
name="tutorial1x.png" src="1_home_red_coding_godot_doc_math_direction.eps"
|
||||
--></td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-1-2-"><td style="white-space:nowrap; text-align:center;" id="TBL-1-2-1"
|
||||
class="td11"> <span
|
||||
class="ecti-0700">Position </span></td><td style="white-space:nowrap; text-align:center;" id="TBL-1-2-2"
|
||||
class="td11"></td><td style="white-space:nowrap; text-align:center;" id="TBL-1-2-3"
|
||||
class="td11"> <span
|
||||
class="ecti-0700">Direction </span></td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-1-3-"><td style="white-space:nowrap; text-align:center;" id="TBL-1-3-1"
|
||||
class="td11"> </td>
|
||||
</tr></table></div>
|
||||
</div>
|
||||
<!--l. 67--><p class="indent" > When used as a direction, this pair is called a <span
|
||||
class="ecti-1000">vector</span>, and two properties can be
|
||||
observed: The first is the <span
|
||||
class="ecti-1000">magnitude </span>or <span
|
||||
class="ecti-1000">length </span>, and the second is the direction. In
|
||||
two dimensions, direction can be an angle. The <span
|
||||
class="ecti-1000">magnitude </span>or <span
|
||||
class="ecti-1000">length </span>can be computed
|
||||
by simply using Pithagoras theorem:
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 73--><p class="noindent" >
|
||||
<div class="tabular"> <table id="TBL-2" class="tabular"
|
||||
cellspacing="0" cellpadding="0"
|
||||
><colgroup id="TBL-2-1g"><col
|
||||
id="TBL-2-1"><col
|
||||
id="TBL-2-2"></colgroup><tr
|
||||
style="vertical-align:baseline;" id="TBL-2-1-"><td style="white-space:nowrap; text-align:center;" id="TBL-2-1-1"
|
||||
class="td11"><img
|
||||
src="tutorial2x.png" alt="∘x2-+-y2-" class="sqrt" ></td><td style="white-space:nowrap; text-align:center;" id="TBL-2-1-2"
|
||||
class="td11"><img
|
||||
src="tutorial3x.png" alt="∘x2-+-y2 +-z2" class="sqrt" ></td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-2-2-"><td style="white-space:nowrap; text-align:center;" id="TBL-2-2-1"
|
||||
class="td11"> <span
|
||||
class="ecti-0700">2D </span></td><td style="white-space:nowrap; text-align:center;" id="TBL-2-2-2"
|
||||
class="td11"> <span
|
||||
class="ecti-0700">3D </span></td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-2-3-"><td style="white-space:nowrap; text-align:center;" id="TBL-2-3-1"
|
||||
class="td11"> </td>
|
||||
</tr></table></div>
|
||||
</div>
|
||||
<!--l. 80--><p class="indent" > The direction can be an arbitrary angle from either the <span
|
||||
class="ecti-1000">x </span>or <span
|
||||
class="ecti-1000">y </span>axis, and could be
|
||||
computed by using trigonometry, or just using the usual <span
|
||||
class="ecti-1000">atan2 </span>function present in
|
||||
most math libraries. However, when dealing with 3D, the direction can’t be described
|
||||
as an angle. To separate magnitude and direction, 3D uses the concept of <span
|
||||
class="ecti-1000">normal</span>
|
||||
<span
|
||||
class="ecti-1000">vectors.</span>
|
||||
<!--l. 88--><p class="noindent" >
|
||||
<h5 class="subsubsectionHead"><span class="titlemark">1.2.2 </span> <a
|
||||
id="x1-50001.2.2"></a>Implementation</h5>
|
||||
<!--l. 90--><p class="noindent" >Vectors are implemented in Godot Engine as a class named <span
|
||||
class="ecti-1000">Vector3 </span>for 3D, and as
|
||||
both <span
|
||||
class="ecti-1000">Vector2</span>, <span
|
||||
class="ecti-1000">Point2 </span>or <span
|
||||
class="ecti-1000">Size2 </span>in 2D (they are all aliases). They are used for any
|
||||
purpose where a pair of 2D or 3D values (described as <span
|
||||
class="ecti-1000">x,y </span>or <span
|
||||
class="ecti-1000">x,y,z) </span>is needed. This is
|
||||
somewhat a standard in most libraries or engines. In the script API, they can be
|
||||
instanced like this:
|
||||
<!--l. 98-->
|
||||
<div class="lstlisting"><span class="label"><a
|
||||
id="x1-5001r1"></a></span>a = Vector3() <br /><span class="label"><a
|
||||
id="x1-5002r2"></a></span>a = Vector2( 2.0, 3.4 )
|
||||
</div>
|
||||
|
||||
<!--l. 104--><p class="indent" > Vectors also support the common operators <span
|
||||
class="ecti-1000">+, -, / and * </span>for addition,
|
||||
substraction, multiplication and division.
|
||||
<!--l. 108-->
|
||||
<div class="lstlisting"><span class="label"><a
|
||||
id="x1-5003r1"></a></span>a = Vector3(1,2,3) <br /><span class="label"><a
|
||||
id="x1-5004r2"></a></span>b = Vector3(4,5,6) <br /><span class="label"><a
|
||||
id="x1-5005r3"></a></span>c = Vector3() <br /><span class="label"><a
|
||||
id="x1-5006r4"></a></span> <br /><span class="label"><a
|
||||
id="x1-5007r5"></a></span>// writing <br /><span class="label"><a
|
||||
id="x1-5008r6"></a></span> <br /><span class="label"><a
|
||||
id="x1-5009r7"></a></span>c = a + b <br /><span class="label"><a
|
||||
id="x1-5010r8"></a></span> <br /><span class="label"><a
|
||||
id="x1-5011r9"></a></span>// is the same as writing <br /><span class="label"><a
|
||||
id="x1-5012r10"></a></span> <br /><span class="label"><a
|
||||
id="x1-5013r11"></a></span>c.x = a.x + b.x <br /><span class="label"><a
|
||||
id="x1-5014r12"></a></span>c.y = a.y + b.y <br /><span class="label"><a
|
||||
id="x1-5015r13"></a></span>c.z = a.z + b.z <br /><span class="label"><a
|
||||
id="x1-5016r14"></a></span> <br /><span class="label"><a
|
||||
id="x1-5017r15"></a></span>// both will result in a vector containing (5,7,9). <br /><span class="label"><a
|
||||
id="x1-5018r16"></a></span>// the same happens for the rest of the operators.
|
||||
</div>
|
||||
<!--l. 128--><p class="indent" > Vectors also can perform a wide variety of built-in functions, their most common
|
||||
usages will be explored next.
|
||||
<!--l. 132--><p class="noindent" >
|
||||
<h5 class="subsubsectionHead"><span class="titlemark">1.2.3 </span> <a
|
||||
id="x1-60001.2.3"></a>Normal Vectors</h5>
|
||||
<!--l. 134--><p class="noindent" >Two points ago, it was mentioned that 3D vectors can’t describe their direction as an
|
||||
agle (as 2D vectors can). Because of this, <span
|
||||
class="ecti-1000">normal vectors </span>become important for
|
||||
separating a vector between <span
|
||||
class="ecti-1000">direction </span>and <span
|
||||
class="ecti-1000">magnitude.</span>
|
||||
<!--l. 139--><p class="indent" > A <span
|
||||
class="ecti-1000">normal vector </span>is a vector with a <span
|
||||
class="ecti-1000">magnitude </span>of <span
|
||||
class="ecti-1000">1. </span>This means, no matter where
|
||||
the vector is pointing to, it’s length is always <span
|
||||
class="ecti-1000">1</span>.
|
||||
<div class="tabular">
|
||||
<table id="TBL-3" class="tabular"
|
||||
cellspacing="0" cellpadding="0"
|
||||
><colgroup id="TBL-3-1g"><col
|
||||
id="TBL-3-1"></colgroup><tr
|
||||
style="vertical-align:baseline;" id="TBL-3-1-"><td style="white-space:nowrap; text-align:center;" id="TBL-3-1-1"
|
||||
class="td11"><img
|
||||
src="tutorial4x.png" alt="PIC" class="graphics" width="100.375pt" height="100.375pt" ><!--tex4ht:graphics
|
||||
name="tutorial4x.png" src="2_home_red_coding_godot_doc_math_normals.eps"
|
||||
--></td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-3-2-"><td style="white-space:nowrap; text-align:center;" id="TBL-3-2-1"
|
||||
class="td11"> <span
|
||||
class="ecrm-0700">Normal vectors aroud the origin. </span></td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-3-3-"><td style="white-space:nowrap; text-align:center;" id="TBL-3-3-1"
|
||||
class="td11"> </td> </tr></table>
|
||||
</div>
|
||||
<!--l. 148--><p class="indent" > Normal vectors have endless uses in 3D graphics programming, so it’s
|
||||
recommended to get familiar with them as much as possible.
|
||||
<!--l. 152--><p class="noindent" >
|
||||
<h5 class="subsubsectionHead"><span class="titlemark">1.2.4 </span> <a
|
||||
id="x1-70001.2.4"></a>Normalization</h5>
|
||||
<!--l. 154--><p class="noindent" >Normalization is the process through which normal vectors are obtained
|
||||
from regular vectors. In other words, normalization is used to reduce the
|
||||
<span
|
||||
class="ecti-1000">magnitude </span>of any vector to <span
|
||||
class="ecti-1000">1</span>. (except of course, unless the vector is (0,0,0)
|
||||
).
|
||||
<!--l. 159--><p class="indent" > To normalize a vector, it must be divided by its magnitude (which should be
|
||||
greater than zero):
|
||||
<!--l. 163-->
|
||||
<div class="lstlisting"><span class="label"><a
|
||||
id="x1-7001r1"></a></span><span
|
||||
class="ecti-1000">//</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">a</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">custom</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">vector</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">is</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">created</span> <br /><span class="label"><a
|
||||
id="x1-7002r2"></a></span>a = Vector3(4,5,6) <br /><span class="label"><a
|
||||
id="x1-7003r3"></a></span><span
|
||||
class="ecti-1000">//</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">’</span><span
|
||||
class="ecti-1000">l</span><span
|
||||
class="ecti-1000">’</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">is</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">a</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">single</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">real</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">number</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">(</span><span
|
||||
class="ecti-1000">or</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">scalar</span><span
|
||||
class="ecti-1000">)</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">containight</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">the</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">length</span> <br /><span class="label"><a
|
||||
id="x1-7004r4"></a></span>l = Math.sqrt( a.x<span
|
||||
class="cmsy-10">*</span>a.x + a.y<span
|
||||
class="cmsy-10">*</span>a.y + a.z<span
|
||||
class="cmsy-10">*</span>a.z ) <br /><span class="label"><a
|
||||
id="x1-7005r5"></a></span><span
|
||||
class="ecti-1000">//</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">the</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">vector</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">’</span><span
|
||||
class="ecti-1000">a</span><span
|
||||
class="ecti-1000">’</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">is</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">divided</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">by</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">its</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">length</span><span
|
||||
class="ecti-1000">,</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">by</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">performing</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">scalar</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">divide</span> <br /><span class="label"><a
|
||||
id="x1-7006r6"></a></span>a = a / l <br /><span class="label"><a
|
||||
id="x1-7007r7"></a></span><span
|
||||
class="ecti-1000">//</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">which</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">is</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">the</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">same</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">as</span> <br /><span class="label"><a
|
||||
id="x1-7008r8"></a></span>a.x = a.x / l <br /><span class="label"><a
|
||||
id="x1-7009r9"></a></span>a.y = a.y / l <br /><span class="label"><a
|
||||
id="x1-7010r10"></a></span>a.z = a.z / l
|
||||
|
||||
</div>
|
||||
<!--l. 177--><p class="indent" > Vector3 contains two built in functions for normalization:
|
||||
<!--l. 180-->
|
||||
<div class="lstlisting"><span class="label"><a
|
||||
id="x1-7011r1"></a></span>a = Vector3(4,5,6) <br /><span class="label"><a
|
||||
id="x1-7012r2"></a></span>a.normalize() <span
|
||||
class="ecti-1000">//</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">in</span><span
|
||||
class="cmsy-10">-</span><span
|
||||
class="ecti-1000">place</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">normalization</span> <br /><span class="label"><a
|
||||
id="x1-7013r3"></a></span>b = a.normalized() <span
|
||||
class="ecti-1000">//</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">returns</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">a</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">copy</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">of</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">a</span><span
|
||||
class="ecti-1000">,</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">normalized</span>
|
||||
</div>
|
||||
<!--l. 188--><p class="noindent" >
|
||||
<h5 class="subsubsectionHead"><span class="titlemark">1.2.5 </span> <a
|
||||
id="x1-80001.2.5"></a>Dot Product</h5>
|
||||
<!--l. 190--><p class="noindent" >The dot product is, pheraps, the most useful operation that can be applied to 3D
|
||||
vectors. In the surface, it’s multiple usages are not very obvious, but in depth it can
|
||||
provide very useful information between two vectors (be it direction or just points in
|
||||
space).
|
||||
<!--l. 195--><p class="indent" > The dot product takes two vectors (<span
|
||||
class="ecti-1000">a </span>and <span
|
||||
class="ecti-1000">b </span>in the example) and returns a scalar
|
||||
(single real number):
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 198--><p class="noindent" >
|
||||
<!--l. 199--><p class="noindent" ><span
|
||||
class="cmmi-10">a</span><sub><span
|
||||
class="cmmi-7">x</span></sub><span
|
||||
class="cmmi-10">b</span><sub><span
|
||||
class="cmmi-7">x</span></sub> <span
|
||||
class="cmr-10">+ </span><span
|
||||
class="cmmi-10">a</span><sub><span
|
||||
class="cmmi-7">y</span></sub><span
|
||||
class="cmmi-10">b</span><sub><span
|
||||
class="cmmi-7">y</span></sub> <span
|
||||
class="cmr-10">+ </span><span
|
||||
class="cmmi-10">a</span><sub><span
|
||||
class="cmmi-7">z</span></sub><span
|
||||
class="cmmi-10">b</span><sub><span
|
||||
class="cmmi-7">z</span></sub>
|
||||
</div>
|
||||
<!--l. 202--><p class="indent" > The same expressed in code:
|
||||
<!--l. 205-->
|
||||
<div class="lstlisting"><span class="label"><a
|
||||
id="x1-8001r1"></a></span>a = Vector3(...) <br /><span class="label"><a
|
||||
id="x1-8002r2"></a></span>b = Vector3(...) <br /><span class="label"><a
|
||||
id="x1-8003r3"></a></span> <br /><span class="label"><a
|
||||
id="x1-8004r4"></a></span>c = a.x<span
|
||||
class="cmsy-10">*</span>b.x + a.y<span
|
||||
class="cmsy-10">*</span>b.y + a.z<span
|
||||
class="cmsy-10">*</span>b.z <br /><span class="label"><a
|
||||
id="x1-8005r5"></a></span> <br /><span class="label"><a
|
||||
id="x1-8006r6"></a></span><span
|
||||
class="ecti-1000">//</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">using</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">built</span><span
|
||||
class="cmsy-10">-</span><span
|
||||
class="ecti-1000">in</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">dot</span><span
|
||||
class="ecti-1000">()</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">function</span> <br /><span class="label"><a
|
||||
id="x1-8007r7"></a></span> <br /><span class="label"><a
|
||||
id="x1-8008r8"></a></span>c = a.dot(b)
|
||||
</div>
|
||||
<!--l. 218--><p class="indent" > The dot product presents several useful properties:
|
||||
<ul class="itemize1">
|
||||
<li class="itemize">If both <span
|
||||
class="ecti-1000">a </span>and <span
|
||||
class="ecti-1000">b </span>parameters to a <span
|
||||
class="ecti-1000">dot product </span>are direction vectors, dot
|
||||
product will return positive if both point towards the same direction,
|
||||
negative if both point towards opposite directions, and zero if they are
|
||||
orthogonal (one is perpendicular to the other).
|
||||
</li>
|
||||
<li class="itemize">If both <span
|
||||
class="ecti-1000">a </span>and <span
|
||||
class="ecti-1000">b </span>parameters to a <span
|
||||
class="ecti-1000">dot product </span>are <span
|
||||
class="ecti-1000">normalized </span>direction
|
||||
vectors, then the dot product will return the cosine of the angle between
|
||||
them (ranging from 1 if they are equal, 0 if they are orthogonal, and -1 if
|
||||
they are opposed (a == -b)).
|
||||
</li>
|
||||
<li class="itemize">If <span
|
||||
class="ecti-1000">a </span>is a <span
|
||||
class="ecti-1000">normalized </span>direction vector and <span
|
||||
class="ecti-1000">b </span>is a point, the dot product will
|
||||
return the distance from <span
|
||||
class="ecti-1000">b </span>to the plane passing through the origin, with
|
||||
normal <span
|
||||
class="ecti-1000">a (see item about planes)</span>
|
||||
|
||||
</li>
|
||||
<li class="itemize">More uses will be presented later in this tutorial.</li></ul>
|
||||
<!--l. 236--><p class="noindent" >
|
||||
<h5 class="subsubsectionHead"><span class="titlemark">1.2.6 </span> <a
|
||||
id="x1-90001.2.6"></a>Cross Product</h5>
|
||||
<!--l. 238--><p class="noindent" >The <span
|
||||
class="ecti-1000">cross product </span>also takes two vectors <span
|
||||
class="ecti-1000">a </span>and <span
|
||||
class="ecti-1000">b</span>, but returns another vector <span
|
||||
class="ecti-1000">c </span>that is
|
||||
orthogonal to the two previous ones.
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 242--><p class="noindent" >
|
||||
<!--l. 243--><p class="noindent" ><span
|
||||
class="cmmi-10">c</span><sub><span
|
||||
class="cmmi-7">x</span></sub> <span
|
||||
class="cmr-10">= </span><span
|
||||
class="cmmi-10">a</span><sub><span
|
||||
class="cmmi-7">x</span></sub><span
|
||||
class="cmmi-10">b</span><sub><span
|
||||
class="cmmi-7">z</span></sub> <span
|
||||
class="cmsy-10">- </span><span
|
||||
class="cmmi-10">a</span><sub><span
|
||||
class="cmmi-7">z</span></sub><span
|
||||
class="cmmi-10">b</span><sub><span
|
||||
class="cmmi-7">y</span></sub>
|
||||
</div>
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 246--><p class="noindent" >
|
||||
<!--l. 247--><p class="noindent" ><span
|
||||
class="cmmi-10">c</span><sub><span
|
||||
class="cmmi-7">y</span></sub> <span
|
||||
class="cmr-10">= </span><span
|
||||
class="cmmi-10">a</span><sub><span
|
||||
class="cmmi-7">z</span></sub><span
|
||||
class="cmmi-10">b</span><sub><span
|
||||
class="cmmi-7">x</span></sub> <span
|
||||
class="cmsy-10">- </span><span
|
||||
class="cmmi-10">a</span><sub><span
|
||||
class="cmmi-7">x</span></sub><span
|
||||
class="cmmi-10">b</span><sub><span
|
||||
class="cmmi-7">z</span></sub>
|
||||
</div>
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 250--><p class="noindent" >
|
||||
<!--l. 251--><p class="noindent" ><span
|
||||
class="cmmi-10">c</span><sub><span
|
||||
class="cmmi-7">z</span></sub> <span
|
||||
class="cmr-10">= </span><span
|
||||
class="cmmi-10">a</span><sub><span
|
||||
class="cmmi-7">x</span></sub><span
|
||||
class="cmmi-10">b</span><sub><span
|
||||
class="cmmi-7">y</span></sub> <span
|
||||
class="cmsy-10">- </span><span
|
||||
class="cmmi-10">a</span><sub><span
|
||||
class="cmmi-7">y</span></sub><span
|
||||
class="cmmi-10">b</span><sub><span
|
||||
class="cmmi-7">x</span></sub>
|
||||
</div>
|
||||
<!--l. 254--><p class="indent" > The same in code:
|
||||
<!--l. 257-->
|
||||
<div class="lstlisting"><span class="label"><a
|
||||
id="x1-9001r1"></a></span>a = Vector3(...) <br /><span class="label"><a
|
||||
id="x1-9002r2"></a></span>b = Vector3(...) <br /><span class="label"><a
|
||||
id="x1-9003r3"></a></span>c = Vector3(...) <br /><span class="label"><a
|
||||
id="x1-9004r4"></a></span> <br /><span class="label"><a
|
||||
id="x1-9005r5"></a></span>c.x = a.x<span
|
||||
class="cmsy-10">*</span>b.z <span
|
||||
class="cmsy-10">-</span> a.z<span
|
||||
class="cmsy-10">*</span>b.y <br /><span class="label"><a
|
||||
id="x1-9006r6"></a></span>c.y = a.z<span
|
||||
class="cmsy-10">*</span>b.x <span
|
||||
class="cmsy-10">-</span> a.x<span
|
||||
class="cmsy-10">*</span>b.z <br /><span class="label"><a
|
||||
id="x1-9007r7"></a></span>c.z = a.x<span
|
||||
class="cmsy-10">*</span>b.y <span
|
||||
class="cmsy-10">-</span> a.y<span
|
||||
class="cmsy-10">*</span>b.x <br /><span class="label"><a
|
||||
id="x1-9008r8"></a></span> <br /><span class="label"><a
|
||||
id="x1-9009r9"></a></span>// or using the built<span
|
||||
class="cmsy-10">-</span>in function <br /><span class="label"><a
|
||||
id="x1-9010r10"></a></span> <br /><span class="label"><a
|
||||
id="x1-9011r11"></a></span>c = a.cross(b)
|
||||
</div>
|
||||
<!--l. 273--><p class="indent" > The <span
|
||||
class="ecti-1000">cross product </span>also presents several useful properties:
|
||||
<ul class="itemize1">
|
||||
<li class="itemize">As mentioned, the resulting vector <span
|
||||
class="ecti-1000">c </span>is orthogonal to the input vectors <span
|
||||
class="ecti-1000">a</span>
|
||||
and <span
|
||||
class="ecti-1000">b.</span>
|
||||
</li>
|
||||
<li class="itemize">Since the <span
|
||||
class="ecti-1000">cross product </span>is anticommutative, swapping <span
|
||||
class="ecti-1000">a </span>and <span
|
||||
class="ecti-1000">b </span>will result
|
||||
in a negated vector <span
|
||||
class="ecti-1000">c.</span>
|
||||
|
||||
</li>
|
||||
<li class="itemize">if <span
|
||||
class="ecti-1000">a </span>and <span
|
||||
class="ecti-1000">b </span>are taken from two of the segmets <span
|
||||
class="ecti-1000">AB</span>, <span
|
||||
class="ecti-1000">BC </span>or <span
|
||||
class="ecti-1000">CA </span>that form a
|
||||
3D triangle, the magnitude of the resulting vector divided by 2 is the area
|
||||
of that triangle.
|
||||
</li>
|
||||
<li class="itemize">The direction of the resulting vector <span
|
||||
class="ecti-1000">c </span>in the previous triangle example
|
||||
determines wether the points A,B and C are arranged in clocwise or
|
||||
counter-clockwise order.</li></ul>
|
||||
<!--l. 287--><p class="noindent" >
|
||||
<h4 class="subsectionHead"><span class="titlemark">1.3 </span> <a
|
||||
id="x1-100001.3"></a>Plane</h4>
|
||||
<!--l. 290--><p class="noindent" >
|
||||
<h5 class="subsubsectionHead"><span class="titlemark">1.3.1 </span> <a
|
||||
id="x1-110001.3.1"></a>Theory</h5>
|
||||
<!--l. 292--><p class="noindent" >A plane can be considered as an infinite, flat surface that splits space in two halves,
|
||||
usually one named positive and one named negative. In regular mathematics, a plane
|
||||
formula is described as:
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 296--><p class="noindent" >
|
||||
<!--l. 297--><p class="noindent" ><span
|
||||
class="cmmi-10">ax </span><span
|
||||
class="cmr-10">+ </span><span
|
||||
class="cmmi-10">by </span><span
|
||||
class="cmr-10">+ </span><span
|
||||
class="cmmi-10">cz </span><span
|
||||
class="cmr-10">+ </span><span
|
||||
class="cmmi-10">d</span>
|
||||
</div>
|
||||
<!--l. 300--><p class="indent" > However, in 3D programming, this form alone is often of little use. For planes to
|
||||
become useful, they must be in normalized form.
|
||||
<!--l. 303--><p class="indent" > A normalized plane consists of a <span
|
||||
class="ecti-1000">normal vector n </span>and a <span
|
||||
class="ecti-1000">distance d. </span>To normalize
|
||||
a plane, a vector <span
|
||||
class="ecti-1000">n </span>and distance <span
|
||||
class="ecti-1000">d’ </span>are created this way:
|
||||
<!--l. 307--><p class="indent" > <span
|
||||
class="cmmi-10">n</span><sub><span
|
||||
class="cmmi-7">x</span></sub> <span
|
||||
class="cmr-10">= </span><span
|
||||
class="cmmi-10">a</span>
|
||||
<!--l. 309--><p class="indent" > <span
|
||||
class="cmmi-10">n</span><sub><span
|
||||
class="cmmi-7">y</span></sub> <span
|
||||
class="cmr-10">= </span><span
|
||||
class="cmmi-10">b</span>
|
||||
<!--l. 311--><p class="indent" > <span
|
||||
class="cmmi-10">n</span><sub><span
|
||||
class="cmmi-7">z</span></sub> <span
|
||||
class="cmr-10">= </span><span
|
||||
class="cmmi-10">c</span>
|
||||
<!--l. 313--><p class="indent" > <span
|
||||
class="cmmi-10">d</span><span
|
||||
class="cmsy-10">′ </span><span
|
||||
class="cmr-10">= </span><span
|
||||
class="cmmi-10">d</span>
|
||||
<!--l. 315--><p class="indent" > Finally, both <span
|
||||
class="ecti-1000">n </span>and <span
|
||||
class="ecti-1000">d’ </span>are both divided by the magnitude of n.
|
||||
<!--l. 318--><p class="indent" > In any case, normalizing planes is not often needed (this was mostly for
|
||||
explanation purposes), and normalized planes are useful because they can be created
|
||||
and used easily.
|
||||
<!--l. 322--><p class="indent" > A normalized plane could be visualized as a plane pointing towards normal <span
|
||||
class="ecti-1000">n,</span>
|
||||
offseted by <span
|
||||
class="ecti-1000">d </span>in the direction of <span
|
||||
class="ecti-1000">n</span>.
|
||||
<!--l. 325--><p class="indent" > In other words, take <span
|
||||
class="ecti-1000">n</span>, multiply it by scalar <span
|
||||
class="ecti-1000">d </span>and the resulting point will be part
|
||||
of the plane. This may need some thinking, so an example with a 2D normal vector
|
||||
(z is 0, so plane is orthogonal to it) is provided:
|
||||
<!--l. 330--><p class="indent" > Some operations can be done with normalized planes:
|
||||
|
||||
<ul class="itemize1">
|
||||
<li class="itemize">Given any point <span
|
||||
class="ecti-1000">p</span>, the distance from it to a plane can be computed by
|
||||
doing: n.dot(p) - d
|
||||
</li>
|
||||
<li class="itemize">If the resulting distance in the previous point is negative, the point is
|
||||
below the plane.
|
||||
</li>
|
||||
<li class="itemize">Convex polygonal shapes can be defined by enclosing them in planes (the
|
||||
physics engine uses this property)</li></ul>
|
||||
<!--l. 340--><p class="noindent" >
|
||||
<h5 class="subsubsectionHead"><span class="titlemark">1.3.2 </span> <a
|
||||
id="x1-120001.3.2"></a>Implementation</h5>
|
||||
<!--l. 342--><p class="noindent" >Godot Engine implements normalized planes by using the <span
|
||||
class="ecti-1000">Plane </span>class.
|
||||
<!--l. 346-->
|
||||
<div class="lstlisting"><span class="label"><a
|
||||
id="x1-12001r1"></a></span>//creates a plane with normal (0,1,0) and distance 5 <br /><span class="label"><a
|
||||
id="x1-12002r2"></a></span>p = Plane( Vector3(0,1,0), 5 ) <br /><span class="label"><a
|
||||
id="x1-12003r3"></a></span>// get the distance to a point <br /><span class="label"><a
|
||||
id="x1-12004r4"></a></span>d = p.distance( Vector3(4,5,6) )
|
||||
</div>
|
||||
<!--l. 355--><p class="noindent" >
|
||||
<h4 class="subsectionHead"><span class="titlemark">1.4 </span> <a
|
||||
id="x1-130001.4"></a>Matrices, Quaternions and Coordinate Systems</h4>
|
||||
<!--l. 357--><p class="noindent" >It is very often needed to store the location/rotation of something. In 2D, it is often
|
||||
enough to store an <span
|
||||
class="ecti-1000">x,y </span>location and maybe an angle as the rotation, as that should
|
||||
be enough to represent any posible position.
|
||||
<!--l. 362--><p class="indent" > In 3D this becomes a little more difficult, as there is nothing as simple as an angle
|
||||
to store a 3-axis rotation.
|
||||
<!--l. 365--><p class="indent" > The first think that may come to mind is to use 3 angles, one for x, one for y and
|
||||
one for z. However this suffers from the problem that it becomes very cumbersome to
|
||||
use, as the individual rotations in each axis need to be performed one after another
|
||||
(they can’t be performed at the same time), leading to a problem called “gimbal
|
||||
lock”. Also, it becomes impossible to accumulate rotations (add a rotation to an
|
||||
existing one).
|
||||
<!--l. 373--><p class="indent" > To solve this, there are two known diferent approaches that aid in solving
|
||||
rotation, <span
|
||||
class="ecti-1000">Quaternions </span>and <span
|
||||
class="ecti-1000">Oriented Coordinate Systems.</span>
|
||||
<!--l. 378--><p class="noindent" >
|
||||
<h5 class="subsubsectionHead"><span class="titlemark">1.4.1 </span> <a
|
||||
id="x1-140001.4.1"></a>Oriented Coordinate Systems</h5>
|
||||
<!--l. 380--><p class="noindent" ><span
|
||||
class="ecti-1000">Oriented Coordinate Systems </span>(<span
|
||||
class="ecti-1000">OCS</span>) are a way of representing a coordinate system
|
||||
inside the cartesian coordinate system. They are mainly composed of 3 Vectors, one
|
||||
for each axis. The first vector is the <span
|
||||
class="ecti-1000">x </span>axis, the second the <span
|
||||
class="ecti-1000">y </span>axis, and the third is the
|
||||
|
||||
<span
|
||||
class="ecti-1000">z </span>axis. The OCS vectors can be rotated around freely as long as they are kept the
|
||||
same length (as changing the length of an axis changes its cale), and as long as they
|
||||
remain orthogonal to eachother (as in, the same as the default cartesian system,
|
||||
with <span
|
||||
class="ecti-1000">y </span>pointing up, <span
|
||||
class="ecti-1000">x </span>pointing left and <span
|
||||
class="ecti-1000">z </span>pointing front, but all rotated
|
||||
together).
|
||||
<!--l. 391--><p class="indent" > <span
|
||||
class="ecti-1000">Oriented Coordinate Systems </span>are represented in 3D programming as a 3x3 matrix,
|
||||
where each row (or column, depending on the implementation) contains one of the
|
||||
axis vectors. Transforming a Vector by a rotated OCS Matrix results in the rotation
|
||||
being applied to the resulting vector. OCS Matrices can also be multiplied to
|
||||
accumulate their transformations.
|
||||
<!--l. 397--><p class="indent" > Godot Engine implements OCS Matrices in the <span
|
||||
class="ecti-1000">Matrix3 </span>class:
|
||||
<!--l. 400-->
|
||||
<div class="lstlisting"><span class="label"><a
|
||||
id="x1-14001r1"></a></span><span
|
||||
class="ecti-1000">//</span><span
|
||||
class="ecti-1000">create</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">a</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">3</span><span
|
||||
class="ecti-1000">x3</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">matrix</span> <br /><span class="label"><a
|
||||
id="x1-14002r2"></a></span>m = Matrix3() <br /><span class="label"><a
|
||||
id="x1-14003r3"></a></span><span
|
||||
class="ecti-1000">//</span><span
|
||||
class="ecti-1000">rotate</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">the</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">matrix</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">in</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">the</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">y</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">axis</span><span
|
||||
class="ecti-1000">,</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">by</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">45</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">degrees</span> <br /><span class="label"><a
|
||||
id="x1-14004r4"></a></span>m.rotate( Vector3(0,1,0), Math.deg2rad(45) ) <br /><span class="label"><a
|
||||
id="x1-14005r5"></a></span><span
|
||||
class="ecti-1000">//</span><span
|
||||
class="ecti-1000">transform</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">a</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">vector</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">v</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">(</span><span
|
||||
class="ecti-1000">xform</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">method</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">is</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">used</span><span
|
||||
class="ecti-1000">)</span> <br /><span class="label"><a
|
||||
id="x1-14006r6"></a></span>v = Vector3(...) <br /><span class="label"><a
|
||||
id="x1-14007r7"></a></span>result = m.xform( v )
|
||||
</div>
|
||||
<!--l. 412--><p class="indent" > However, in most usage cases, one wants to store a translation together with the
|
||||
rotation. For this, an <span
|
||||
class="ecti-1000">origin </span>vector must be added to the OCS, thus transforming it
|
||||
into a 3x4 (or 4x3, depending on preference) matrix. Godot engine implements this
|
||||
functionality in the <span
|
||||
class="ecti-1000">Transform </span>class:
|
||||
<!--l. 419-->
|
||||
<div class="lstlisting"><span class="label"><a
|
||||
id="x1-14010r1"></a></span>t = Transform() <br /><span class="label"><a
|
||||
id="x1-14011r2"></a></span>//rotate the transform in the y axis, by 45 degrees <br /><span class="label"><a
|
||||
id="x1-14012r3"></a></span>t.rotate( Vector3(0,1,0), Math.deg2rad(45) ) <br /><span class="label"><a
|
||||
id="x1-14013r4"></a></span>//translate the transform by 5 in the z axis <br /><span class="label"><a
|
||||
id="x1-14014r5"></a></span>t.translate( Vector3( 0,0,5 ) ) <br /><span class="label"><a
|
||||
id="x1-14015r6"></a></span>//transform a vector v (xform method is used) <br /><span class="label"><a
|
||||
id="x1-14016r7"></a></span>v = Vector3(...) <br /><span class="label"><a
|
||||
id="x1-14017r8"></a></span>result = t.xform( v )
|
||||
</div>
|
||||
<!--l. 431--><p class="indent" > Transform contains internally a Matrix3 “basis” and a Vector3 “origin” (which can
|
||||
be modified individually).
|
||||
<!--l. 435--><p class="noindent" >
|
||||
<h5 class="subsubsectionHead"><span class="titlemark">1.4.2 </span> <a
|
||||
id="x1-150001.4.2"></a>Transform Internals</h5>
|
||||
<!--l. 437--><p class="noindent" >Internally, the xform() process is quite simple, to apply a 3x3 transform to a vector,
|
||||
the transposed axis vectors are used (as using the regular axis vectors will result on
|
||||
an inverse of the desired transform):
|
||||
<!--l. 442-->
|
||||
<div class="lstlisting"><span class="label"><a
|
||||
id="x1-15001r1"></a></span>m = Matrix3(...) <br /><span class="label"><a
|
||||
id="x1-15002r2"></a></span>v = Vector3(..) <br /><span class="label"><a
|
||||
id="x1-15003r3"></a></span>result = Vector3(...) <br /><span class="label"><a
|
||||
id="x1-15004r4"></a></span> <br /><span class="label"><a
|
||||
id="x1-15005r5"></a></span>x_axis = m.get_axis(0) <br /><span class="label"><a
|
||||
id="x1-15006r6"></a></span>y_axis = m.get_axis(1) <br /><span class="label"><a
|
||||
id="x1-15007r7"></a></span>z_axis = m.get_axis(2) <br /><span class="label"><a
|
||||
id="x1-15008r8"></a></span> <br /><span class="label"><a
|
||||
id="x1-15009r9"></a></span>result.x = Vector3(x_axis.x, y_axis.x, z_axis.x).dot(v) <br /><span class="label"><a
|
||||
id="x1-15010r10"></a></span>result.y = Vector3(x_axis.y, y_axis.y, z_axis.y).dot(v) <br /><span class="label"><a
|
||||
id="x1-15011r11"></a></span>result.z = Vector3(x_axis.z, y_axis.z, z_axis.z).dot(v) <br /><span class="label"><a
|
||||
id="x1-15012r12"></a></span> <br /><span class="label"><a
|
||||
id="x1-15013r13"></a></span>// is the same as doing <br /><span class="label"><a
|
||||
id="x1-15014r14"></a></span> <br /><span class="label"><a
|
||||
id="x1-15015r15"></a></span>result = m.xform(v) <br /><span class="label"><a
|
||||
id="x1-15016r16"></a></span> <br /><span class="label"><a
|
||||
id="x1-15017r17"></a></span>// if m this was a Transform(), the origin would be added <br /><span class="label"><a
|
||||
id="x1-15018r18"></a></span>// like this: <br /><span class="label"><a
|
||||
id="x1-15019r19"></a></span> <br /><span class="label"><a
|
||||
id="x1-15020r20"></a></span>result = result + t.get_origin()
|
||||
</div>
|
||||
<!--l. 468--><p class="noindent" >
|
||||
<h5 class="subsubsectionHead"><span class="titlemark">1.4.3 </span> <a
|
||||
id="x1-160001.4.3"></a>Using The Transform</h5>
|
||||
<!--l. 470--><p class="noindent" >So, it is often desired apply sucessive operations to a transformation. For example,
|
||||
let’s a assume that there is a turtle sitting at the origin (the turtle is a logo reference,
|
||||
|
||||
for those familiar with it). The <span
|
||||
class="ecti-1000">y </span>axis is up, and the the turtle’s nose is pointing
|
||||
towards the <span
|
||||
class="ecti-1000">z </span>axis.
|
||||
<!--l. 476--><p class="indent" > The turtle (like many other animals, or vehicles!) can only walk towards the
|
||||
direction it’s looking at. So, moving the turtle around a little should be something
|
||||
like this:
|
||||
<!--l. 481-->
|
||||
<div class="lstlisting"><span class="label"><a
|
||||
id="x1-16001r1"></a></span><span
|
||||
class="ecti-1000">//</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">turtle</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">at</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">the</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">origin</span> <br /><span class="label"><a
|
||||
id="x1-16002r2"></a></span>turtle = Transform() <br /><span class="label"><a
|
||||
id="x1-16003r3"></a></span><span
|
||||
class="ecti-1000">//</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">turtle</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">will</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">walk</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">5</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">units</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">in</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">z</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">axis</span> <br /><span class="label"><a
|
||||
id="x1-16004r4"></a></span>turtle.translate( Vector3(0,0,5) ) <br /><span class="label"><a
|
||||
id="x1-16005r5"></a></span><span
|
||||
class="ecti-1000">//</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">turtle</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">eyes</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">a</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">lettuce</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">3</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">units</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">away</span><span
|
||||
class="ecti-1000">,</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">will</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">rotate</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">45</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">degrees</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">right</span> <br /><span class="label"><a
|
||||
id="x1-16006r6"></a></span>turtle.rotate( Vector3(0,1,0), Math.deg2rad(45) ) <br /><span class="label"><a
|
||||
id="x1-16007r7"></a></span><span
|
||||
class="ecti-1000">//</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">turtle</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">approaches</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">the</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">lettuce</span> <br /><span class="label"><a
|
||||
id="x1-16008r8"></a></span>turtle.translate( Vector3(0,0,5) ) <br /><span class="label"><a
|
||||
id="x1-16009r9"></a></span><span
|
||||
class="ecti-1000">//</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">happy</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">turtle</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">over</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">lettuce</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">is</span><span
|
||||
class="ecti-1000"> </span><span
|
||||
class="ecti-1000">at</span> <br /><span class="label"><a
|
||||
id="x1-16010r10"></a></span>print(turtle.get_origin())
|
||||
</div>
|
||||
<!--l. 496--><p class="indent" > As can be seen, every new action the turtle takes is based on the previous one it
|
||||
took. Had the order of actions been different and the turtle would have never reached
|
||||
the lettuce.
|
||||
<!--l. 500--><p class="indent" > Transforms are just that, a mean of “accumulating” rotation, translation, scale,
|
||||
etc.
|
||||
<!--l. 504--><p class="noindent" >
|
||||
<h5 class="subsubsectionHead"><span class="titlemark">1.4.4 </span> <a
|
||||
id="x1-170001.4.4"></a>A Warning about Numerical Precision</h5>
|
||||
<!--l. 506--><p class="noindent" >Performing several actions over a transform will slowly and gradually lead to
|
||||
precision loss (objects that draw according to a transform may get jittery, bigger,
|
||||
smaller, skewed, etc). This happens due to the nature of floating point numbers. if
|
||||
transforms/matrices are created from other kind of values (like a position and
|
||||
some angular rotation) this is not needed, but if has been accumulating
|
||||
transformations and was never recreated, it can be normalized by calling the
|
||||
.orthonormalize() built-in function. This function has little cost and calling it every
|
||||
now and then will avoid the effects from precision loss to become visible.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 618 B |
Before Width: | Height: | Size: 754 B |
Before Width: | Height: | Size: 2.9 KiB |
|
@ -1,17 +0,0 @@
|
|||
#! /bin/bash
|
||||
here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
godotHome=$(dirname "$here")
|
||||
docTarget=${here}/html/class_list
|
||||
toolsRoot=${godotHome}/tools
|
||||
|
||||
throw() {
|
||||
echo "$@" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
[ -d "$docTarget" ] || mkdir -p "$docTarget" || throw "Could not create doc target $docTarget"
|
||||
|
||||
cd "$docTarget"
|
||||
python ${toolsRoot}/docdump/makehtml.py -multipage ${here}/base/classes.xml
|
||||
cd "$here"
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
|
||||
in FileDialog file_selected -> file_activated
|
||||
focus script/shader editor when gaining focus
|
||||
detect if errors in editor and don't allow play
|
||||
|
||||
|
||||
-tree of files (all recognized extensions)
|
||||
|
||||
*export: *keep|export|bundle
|
||||
*options: [make binary for xnl], then options for each filetype (texture compress method, etc)
|
||||
|
||||
|
||||
config.h deberia teber varias cosas de plataforma
|
||||
|
||||
_FORCE_INLINE_
|
||||
copymem
|
||||
ftoi
|
||||
defines de funciones matematicas
|
||||
|
||||
|
Before Width: | Height: | Size: 28 KiB |
984
doc/squirrel.lyx
|
@ -1,984 +0,0 @@
|
|||
#LyX 2.0 created this file. For more info see http://www.lyx.org/
|
||||
\lyxformat 413
|
||||
\begin_document
|
||||
\begin_header
|
||||
\textclass article
|
||||
\use_default_options true
|
||||
\maintain_unincluded_children false
|
||||
\language english
|
||||
\language_package default
|
||||
\inputencoding auto
|
||||
\fontencoding global
|
||||
\font_roman default
|
||||
\font_sans default
|
||||
\font_typewriter default
|
||||
\font_default_family default
|
||||
\use_non_tex_fonts false
|
||||
\font_sc false
|
||||
\font_osf false
|
||||
\font_sf_scale 100
|
||||
\font_tt_scale 100
|
||||
|
||||
\graphics default
|
||||
\default_output_format default
|
||||
\output_sync 0
|
||||
\bibtex_command default
|
||||
\index_command default
|
||||
\paperfontsize default
|
||||
\use_hyperref false
|
||||
\papersize default
|
||||
\use_geometry false
|
||||
\use_amsmath 1
|
||||
\use_esint 1
|
||||
\use_mhchem 1
|
||||
\use_mathdots 1
|
||||
\cite_engine basic
|
||||
\use_bibtopic false
|
||||
\use_indices false
|
||||
\paperorientation portrait
|
||||
\suppress_date false
|
||||
\use_refstyle 1
|
||||
\index Index
|
||||
\shortcut idx
|
||||
\color #008000
|
||||
\end_index
|
||||
\secnumdepth 3
|
||||
\tocdepth 3
|
||||
\paragraph_separation indent
|
||||
\paragraph_indentation default
|
||||
\quotes_language english
|
||||
\papercolumns 1
|
||||
\papersides 1
|
||||
\paperpagestyle default
|
||||
\tracking_changes false
|
||||
\output_changes false
|
||||
\html_math_output 0
|
||||
\html_css_as_file 0
|
||||
\html_be_strict false
|
||||
\end_header
|
||||
|
||||
\begin_body
|
||||
|
||||
\begin_layout Title
|
||||
Squirrel Usage in Godot
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
Introduction
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Squirrel is a nice scripting language.
|
||||
It's sort of a mix between Lua, Java and JavaScript and ends up being easy
|
||||
to learn for most programmers.
|
||||
It has more language features than GDScript but it's also slower, more
|
||||
limited and not as well integrated.
|
||||
This guide will explain how Squirrel is integrated to Godot and all the
|
||||
quirks that are needed to know in order to use it properly.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
Enabling Squirrel
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Squirrel may not be enabled by default in a Godot build.
|
||||
To enable it, execute SCons with the following parameters:
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\begin_inset listings
|
||||
inline false
|
||||
status open
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
shell$ scons squirrel=yes <target_binary>
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
Documentation
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Godot utilizes Squirrel 2.2.
|
||||
Documentation can be found at:
|
||||
\begin_inset CommandInset href
|
||||
LatexCommand href
|
||||
target "http://squirrel-lang.org/#documentation"
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
Class Files
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Unless writing a library, Godot expects a class for scripting an object.
|
||||
Since a Squirrel source file can contain many classes, the main class must
|
||||
be returned.
|
||||
The following is an example of extending a button:
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\begin_inset listings
|
||||
inline false
|
||||
status open
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
class MyButton extends Button {
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
constructor() {
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
// ALWAYS call parent constructor
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
Button.constructor()
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
}
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
}
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
return MyButton // main class returned
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Additionally, classes are all copied to the root table, so all class names
|
||||
in scripts must be different if they are attempted to be loaded simultaneously.
|
||||
The same can be said for any other globals declared in the script.
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Finally, squirrel scripts must be saved with the .nut or .sq extensions (both
|
||||
are recognized).
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
Including Other Scripts
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Other scripts can be included with the include() directive.
|
||||
Full and relative paths are supported.
|
||||
When included, the classes and globals are moved to the root table, so
|
||||
they become immediately available.
|
||||
Constants, however, are only inlined in the current class on load, so Squirrel
|
||||
does not make them available.
|
||||
Example of including scripts:
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\begin_inset listings
|
||||
inline false
|
||||
status open
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
include("my_button.nut") # // relative to current script, expected to be
|
||||
in the same path
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
include("res://buttons/my_button.nut") // using resource path
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
Built-In Types
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
There are some small differences between the Built-In types in Godot and
|
||||
the ones in Squirrel, so the documentation will not match.
|
||||
The differences are documented here.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
An attempt will be made to document everything here,but if in doubt about
|
||||
bindings on built-in types, you can always take a loot at the bindings
|
||||
source file in script/squirrel/sq_bind_types.cpp.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Built-In Types in Squirrel are passed by reference (unlike by value like
|
||||
in GD).
|
||||
They also don't need to be freed.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
AABB
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\begin_inset Quotes eld
|
||||
\end_inset
|
||||
|
||||
pos
|
||||
\begin_inset Quotes erd
|
||||
\end_inset
|
||||
|
||||
,
|
||||
\begin_inset Quotes eld
|
||||
\end_inset
|
||||
|
||||
size
|
||||
\begin_inset Quotes erd
|
||||
\end_inset
|
||||
|
||||
and
|
||||
\begin_inset Quotes eld
|
||||
\end_inset
|
||||
|
||||
end
|
||||
\begin_inset Quotes erd
|
||||
\end_inset
|
||||
|
||||
are not available Use get_pos()/set_pos and get_size()/set_size().
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
InputEvent
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
InputEvent is a single datatype and contains everything.
|
||||
Use only the fields meant for the event type:
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\begin_inset listings
|
||||
inline false
|
||||
status open
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
//for mouse motion and button
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
int mouse_x
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
int mouse_y
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
int mouse_button_mask
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
int mouse_global_x
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
int mouse_global_y
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
//for mouse button
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
int mouse_button_index
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
bool mouse_button_pressed
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
bool mouse_button_doubleclick
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
//for mouse motion
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
int mouse_motion_x
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
int mouse_motion_y
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
//for keyboard
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
int key_scancode
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
int key_unicode
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
bool key_pressed
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
bool key_echo
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
//for keyboard and mouse
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
bool mod_alt
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
bool mod_shift
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
bool mod_meta
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
bool mod_control
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
//joy button
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
int joy_button_index
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
bool joy_button_pressed
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
//joy axis
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
int joy_axis
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
float joy_axis_value
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
//screen drag and touch
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
int screen_index
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
int screen_x
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
int screen_y
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
//screen touch
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
int screen_index
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
//action
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
int action_id
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
bool action_pressed
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
Matrix3
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
x,y,z member vectors are not available.
|
||||
Use get_row() and set_row() instead.
|
||||
Individual float values of the matrix are available as swizzle masks such
|
||||
as xxy, xyz, zzx, etc.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Additional in-place versions of some functions are available: transpose(),
|
||||
invert(), rotate(), scale(), orthonormalize().
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
Transform
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\begin_inset Quotes eld
|
||||
\end_inset
|
||||
|
||||
basis
|
||||
\begin_inset Quotes erd
|
||||
\end_inset
|
||||
|
||||
and
|
||||
\begin_inset Quotes eld
|
||||
\end_inset
|
||||
|
||||
origin
|
||||
\begin_inset Quotes erd
|
||||
\end_inset
|
||||
|
||||
members are not available.
|
||||
Use get_basis()/set_basis() and get_origin()/set_origin() instead.
|
||||
Additional in-place versions of some functions are available: invert(),
|
||||
affine_invert(), orthonormalize(), rotate(), translate(), scale().
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Vector2
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
Plane
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\begin_inset Quotes eld
|
||||
\end_inset
|
||||
|
||||
normal
|
||||
\begin_inset Quotes erd
|
||||
\end_inset
|
||||
|
||||
member vector is not available.
|
||||
Use get_normal(), set_normal() instead.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
Rect2
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\begin_inset Quotes eld
|
||||
\end_inset
|
||||
|
||||
pos
|
||||
\begin_inset Quotes erd
|
||||
\end_inset
|
||||
|
||||
,
|
||||
\begin_inset Quotes eld
|
||||
\end_inset
|
||||
|
||||
size
|
||||
\begin_inset Quotes erd
|
||||
\end_inset
|
||||
|
||||
and
|
||||
\begin_inset Quotes eld
|
||||
\end_inset
|
||||
|
||||
end
|
||||
\begin_inset Quotes erd
|
||||
\end_inset
|
||||
|
||||
are not available Use get_pos()/set_pos and get_size()/set_size().
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
Native Arrays
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Native arrays such as RawArray, IntArray,StringArray, etc are not supported.
|
||||
Use regular squirrel arrays instead, since conversion to/from them will
|
||||
happen automatically.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
Math Functions
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Math functions are inside the Math namespace in Squirrel.
|
||||
For example Math.sin , Math.PI, Math.atan2().
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
Native Types
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Array, Dictionary and NodePath are not available.
|
||||
Use a native array, table and string respectively.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
_get , _set
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
_get and _set are reserved in Squirrel, for overriding Godot Object property
|
||||
getter/setter, use _get_property and _set_property.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
Member Export
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Simple exporting of members (so far only integer, floating point and string
|
||||
are supported) is supported by the @export extension.
|
||||
It is used like this:
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\begin_inset listings
|
||||
inline false
|
||||
status open
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
class MyButton extends Button {
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
aprop=1 // @export
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
bprop=2.0 // @export
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
cprop="3" // @export
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
//these will be available to the property editor, and will be loaded/saved
|
||||
with the scene.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
}
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
Always Enabled Scripts
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Scripts are not enabled in the editor by default.
|
||||
To enable a script always, add an @always_enabled comment.
|
||||
Example:
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\begin_inset listings
|
||||
inline false
|
||||
status open
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
//@always_enabled
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
class MyButton extends Button {
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
...
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
Threads
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Thread support in Squirrel is very poor.
|
||||
This is because of the stack-based nature of the language implementation.
|
||||
Since godot can run in multiple threads, it will forcibily lock the whole
|
||||
VM when accessed from multiple threads, which will result in degraded performan
|
||||
ce.
|
||||
Creating user threads in Squirrel is definitely not recomended, as it may
|
||||
completely lock the main thread.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
References
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Godot has a built-in reference counted type used in conjunction with a template
|
||||
(objects that inherit the
|
||||
\begin_inset Quotes eld
|
||||
\end_inset
|
||||
|
||||
Reference
|
||||
\begin_inset Quotes erd
|
||||
\end_inset
|
||||
|
||||
class).
|
||||
Since Squirrel also uses reference counting, it becomes impossible for
|
||||
such types in godot to contain a script, because it would result in an
|
||||
un-breakable reference cycle.
|
||||
To avoid this, a Ref() class was created in Squirrel.
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
When calling Godot API functions, returned references are wrapped inside
|
||||
Ref() transparently, but the problem arises when creating a Reference-derived
|
||||
object from the code.
|
||||
In such cases, the reference must be wrapped manually like this:
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\begin_inset listings
|
||||
inline false
|
||||
status open
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
local f = Ref( File() )
|
||||
\end_layout
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
local err = f.open("hello.txt",File.READ)
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Anything not a reference that inherits from Object can be freed manually
|
||||
by calling .free(), just like in GDScript.
|
||||
Object classes are in itself weak references to engine objects, and their
|
||||
validity can be checked by calling the
|
||||
\begin_inset Quotes eld
|
||||
\end_inset
|
||||
|
||||
has_instance()
|
||||
\begin_inset Quotes erd
|
||||
\end_inset
|
||||
|
||||
built-in method.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
Unicode
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Squirrel source code is supposed to support Unicode, but the implementation
|
||||
is very broken (Squirrel attempts to use 16 bit chars no matter what, making
|
||||
it incompatible when the host OS is 32 bit, like Linux).
|
||||
Squirrel source code is parsed as UTF-8, and strings also contain UTF-8.
|
||||
Wide char access in strings is not supported.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
Debugging
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Squirrel is well integrated into the Godot debugger.
|
||||
To run the project in debug mode, execute the godot binary with the -debug
|
||||
argument.
|
||||
Godot will break on squirrel errors and allow the programmer to debug.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
Utility Functions
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
There are a few squirrel-only utility functions available:
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
print(value[,value])
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Print stuff to stdout.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
dofile(path)
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Execute a squirrel script file and return whatever the file returns.
|
||||
Not recommended to use in production because it can't be optimized.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
nativeref(var)
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Convert any squirrel type to an engine type.
|
||||
When this type returns to squirrel, it's converted back.
|
||||
This is useful to add to Godot callbacks to ensure that the datatype is
|
||||
not converted.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
unicode_split(string)
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Split an unicode string (utf8) into an array of widechars.
|
||||
Useful since there is no wide char access from Squirrel.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
breakpoint()
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Stop the debugger when reaches here (when run inside the debugger).
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
backtrace()
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Print a backtrace of the call stack.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
tr(text)
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Translate text (use string lookup in Godot translation system).
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
printerr(text)
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Print a string to stderr.
|
||||
\end_layout
|
||||
|
||||
\end_body
|
||||
\end_document
|
39
doc/todo.txt
|
@ -1,39 +0,0 @@
|
|||
-Fisica 2D
|
||||
*terminar constraints
|
||||
*terminar queries
|
||||
*desactivar on suspend
|
||||
-bugs supongo?
|
||||
|
||||
-Fisica 3D
|
||||
-portar engine 2D a 3D mayoritariamente (si puedo esperar, mejor)
|
||||
-hacer que skeletons se vuelvan ragdolls de alguna forma
|
||||
-hacer bien lo de enganchar cosas a huesos de esqueleto
|
||||
|
||||
-GUI
|
||||
- Tree necesita resizear desde los headers
|
||||
|
||||
-Escena 3D
|
||||
-Deshabilitar 3D (Opcional en compilacion)
|
||||
-Particulas 3D
|
||||
-Heightmaps
|
||||
-Arreglar fixed pipeline
|
||||
-arreglar glow y ssao
|
||||
|
||||
-Editor codigo
|
||||
-Editor de codigo (esta, pero esta lleno de bugs)
|
||||
-Debugger (esta, pero hay que integrar bien)
|
||||
|
||||
-UI General
|
||||
-Cambiar lugar el tema de resources porque es MUY poco intuitivo
|
||||
-Tal vez arreglar un poquito el theme y la estetica (para release, low priority)
|
||||
-Run deberia correr la escena main
|
||||
-new script deberia dar opcion de crear en disco
|
||||
-los scripts de deberian mantener abiertos al abrir otra escena
|
||||
-
|
||||
|
||||
-Settings
|
||||
-Hacer pantalla de optimizacion general del proyecto
|
||||
|
||||
-A futuro:
|
||||
-Scripting Propio
|
||||
-Portar a DX9/GL3
|
|
@ -1,3 +1,6 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import xml.etree.ElementTree as ET
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
# TODO:
|
||||
# * Refactor code.
|
||||
# * Adapt this script for generating content in other markup formats like
|
||||
# DokuWiki, Markdown, etc.
|
||||
# reStructuredText, Markdown, DokuWiki, etc.
|
||||
#
|
||||
# Also check other TODO entries in this script for more information on what is
|
||||
# left to do.
|
|
@ -1,3 +1,6 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
|
@ -8,7 +11,7 @@ for arg in sys.argv[1:]:
|
|||
input_list.append(arg)
|
||||
|
||||
if len(input_list) < 1:
|
||||
print("usage: makedoku.py <class_list.xml>")
|
||||
print("usage: makedoku.py <classes.xml>")
|
||||
sys.exit(0)
|
||||
|
||||
|
|
@ -1,3 +1,6 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import xml.etree.ElementTree as ET
|
||||
from xml.sax.saxutils import escape, unescape
|
||||
|
@ -29,7 +32,7 @@ for arg in sys.argv[1:]:
|
|||
input_list.append(arg)
|
||||
|
||||
if len(input_list) < 1:
|
||||
print("usage: makehtml.py <class_list.xml>")
|
||||
print("usage: makehtml.py <classes.xml>")
|
||||
sys.exit(0)
|
||||
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
|
@ -9,7 +10,7 @@ for arg in sys.argv[1:]:
|
|||
input_list.append(arg)
|
||||
|
||||
if len(input_list) < 1:
|
||||
print 'usage: makedoku.py <class_list.xml>'
|
||||
print 'usage: makemd.py <classes.xml>'
|
||||
sys.exit(0)
|
||||
|
||||
|
|
@ -1,557 +0,0 @@
|
|||
#LyX 1.6.5 created this file. For more info see http://www.lyx.org/
|
||||
\lyxformat 345
|
||||
\begin_document
|
||||
\begin_header
|
||||
\textclass article
|
||||
\use_default_options true
|
||||
\language english
|
||||
\inputencoding auto
|
||||
\font_roman default
|
||||
\font_sans default
|
||||
\font_typewriter default
|
||||
\font_default_family default
|
||||
\font_sc false
|
||||
\font_osf false
|
||||
\font_sf_scale 100
|
||||
\font_tt_scale 100
|
||||
|
||||
\graphics default
|
||||
\paperfontsize default
|
||||
\use_hyperref false
|
||||
\papersize default
|
||||
\use_geometry false
|
||||
\use_amsmath 1
|
||||
\use_esint 1
|
||||
\cite_engine basic
|
||||
\use_bibtopic false
|
||||
\paperorientation portrait
|
||||
\secnumdepth 3
|
||||
\tocdepth 3
|
||||
\paragraph_separation indent
|
||||
\defskip medskip
|
||||
\quotes_language english
|
||||
\papercolumns 1
|
||||
\papersides 1
|
||||
\paperpagestyle default
|
||||
\tracking_changes false
|
||||
\output_changes false
|
||||
\author ""
|
||||
\author ""
|
||||
\end_header
|
||||
|
||||
\begin_body
|
||||
|
||||
\begin_layout Title
|
||||
01.
|
||||
Getting Started with Godot Engine
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section*
|
||||
Introduction:
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Godot Engine is designed to be useful.
|
||||
This may sound rather vague and is difficult to explain without repeating
|
||||
the same claims that every other engine does, but, as we progress through
|
||||
this (and the next) tutorials, hopefully it will be made clear what
|
||||
\begin_inset Quotes eld
|
||||
\end_inset
|
||||
|
||||
useful
|
||||
\begin_inset Quotes erd
|
||||
\end_inset
|
||||
|
||||
means.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Godot Engine has many components, both high and low level, and is usually
|
||||
more abstract and complex than most other engines.
|
||||
This is, however, to the advantage of the user as complexity is presented
|
||||
in a way that it only needs to be discovered when more power needs to be
|
||||
untapped.
|
||||
This helps to provide an easy learning curve.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Design wise, the whole API and set of components were created with a clear
|
||||
goal in mind, which is to allow for smooth integration of design ideas,
|
||||
code and assets.
|
||||
This is achieved by defining the following rules:
|
||||
\end_layout
|
||||
|
||||
\begin_layout Itemize
|
||||
Implementing a game feature should never be too many steps away from an
|
||||
existing component.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Itemize
|
||||
More complex features should be leveraged by combining or extending existing
|
||||
components.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Itemize
|
||||
If the above fails, creating custom components should be extremely simple.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Ultimately, Godot Engine provides an editor and tools that allows everyone
|
||||
to work with it:
|
||||
\end_layout
|
||||
|
||||
\begin_layout Itemize
|
||||
Programmers can script and extend any component of the project.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Itemize
|
||||
Designers can tweak and animate any parameter from a friendly user interface.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Itemize
|
||||
Artists can import their art and models and tweak the look of everything
|
||||
in realtime.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section*
|
||||
Editor:
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
As mentioned before, Godot Engine is very abstract so projects consist of
|
||||
just a
|
||||
\emph on
|
||||
path
|
||||
\emph default
|
||||
(ie: C:
|
||||
\backslash
|
||||
games
|
||||
\backslash
|
||||
mygame5).
|
||||
Projects don't have to be specifically created, and many can be placed
|
||||
inside the same path (useful for not wasting folders on tests and experiments).
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
In any case, to ease the management of projects, a graphical util exists.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection*
|
||||
Running From The Project Manager
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Godot Engine includes a built-in project manager.
|
||||
This is installed by default on Windows and OSX and it allows for the creation
|
||||
and removal projects that will be remembered at the next startup:
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\align center
|
||||
\begin_inset Graphics
|
||||
filename pm.png
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
To create a new project, the [Create] button must be pressed and a dialog
|
||||
will appear, prompting for a path and project name.
|
||||
Afterwards, the [Open] button will close the project manager and open the
|
||||
desired project.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection*
|
||||
Running From the Command Line
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
To create and manage projects, it is perfectly possible to use the command
|
||||
line.
|
||||
Many users prefer this way of working with project data.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\align center
|
||||
\begin_inset Graphics
|
||||
filename pmc.png
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
For ease of use, it is recommended that the
|
||||
\begin_inset Quotes eld
|
||||
\end_inset
|
||||
|
||||
godot
|
||||
\begin_inset Quotes erd
|
||||
\end_inset
|
||||
|
||||
binary exists in the path, so any project can be opened easily aywhere
|
||||
just by changing location to the projec and executing the editor.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection*
|
||||
Godot Editor
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Godot Editor should have been opened by now, if not please check the previous
|
||||
steps again.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Godot has a powerful buit-in editor.
|
||||
It uses the graphics toolkint within itself to display the UI, so it runs
|
||||
identical on any platform (even consoles or phones!).
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\align center
|
||||
\begin_inset Graphics
|
||||
filename editor.png
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
In the above screenshots, a few regions are labelled to be explained as
|
||||
follows:
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsubsection*
|
||||
Viewport
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
The
|
||||
\emph on
|
||||
Viewport
|
||||
\emph default
|
||||
is the main space where the content is displayed.
|
||||
Content includes 3D Nodes or Graphical User Interface (GUI) controls.
|
||||
Other types of data spawn editors of their own when being edited.
|
||||
The default viewport is the 3D viewport, which can be panned, zoomed, etc.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsubsection*
|
||||
Scene Tree
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
The
|
||||
\emph on
|
||||
Scene Tree
|
||||
\emph default
|
||||
is a small dock that displays the tree of the current scene being edited.
|
||||
A scene is a collection of nodes arranged in a tree-hierarchy (any node
|
||||
can have several owned children-nodes).
|
||||
The meaning of this ownership depends purely on the
|
||||
\emph on
|
||||
type
|
||||
\emph default
|
||||
of the node, but it will become clear after going through the examples.
|
||||
In a
|
||||
\emph on
|
||||
MVC
|
||||
\emph default
|
||||
pattern, the scene tree could be considered the
|
||||
\emph on
|
||||
View
|
||||
\emph default
|
||||
.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsubsection*
|
||||
Property Editor
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
The
|
||||
\emph on
|
||||
Property Editor
|
||||
\emph default
|
||||
is another small dock.
|
||||
Every node contains a finite number of
|
||||
\emph on
|
||||
properties
|
||||
\emph default
|
||||
, which can be edited.
|
||||
Properties can be of several types, such as integers, strings, images,
|
||||
matrices, etc.
|
||||
Usually, changes to properties are reflected in the
|
||||
\emph on
|
||||
viewport
|
||||
\emph default
|
||||
in real time.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section*
|
||||
Examples:
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
From now, a few, simple examples will be presented that will help understand
|
||||
a little better how Godot Engine works.
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsubsection*
|
||||
Hello, World!
|
||||
\end_layout
|
||||
|
||||
\begin_layout Enumerate
|
||||
Open the editor
|
||||
\end_layout
|
||||
|
||||
\begin_layout Enumerate
|
||||
Click on
|
||||
\begin_inset Quotes eld
|
||||
\end_inset
|
||||
|
||||
Node
|
||||
\begin_inset Quotes erd
|
||||
\end_inset
|
||||
|
||||
(Node Menu), then on
|
||||
\begin_inset Quotes eld
|
||||
\end_inset
|
||||
|
||||
Create Root
|
||||
\begin_inset Quotes erd
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_deeper
|
||||
\begin_layout Standard
|
||||
\align center
|
||||
\begin_inset Graphics
|
||||
filename tute1_1.png
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\end_deeper
|
||||
\begin_layout Enumerate
|
||||
Create a node of type
|
||||
\emph on
|
||||
Label,
|
||||
\emph default
|
||||
then instruct the
|
||||
\emph on
|
||||
editor
|
||||
\emph default
|
||||
to switch to GUI editing mode.
|
||||
A few red squares will appear on the top left corner, don't mind them yet.
|
||||
\end_layout
|
||||
|
||||
\begin_deeper
|
||||
\begin_layout Standard
|
||||
\align center
|
||||
\begin_inset Graphics
|
||||
filename tute1_2.png
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\align center
|
||||
\begin_inset Graphics
|
||||
filename tute1_2b.png
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\align center
|
||||
\begin_inset Graphics
|
||||
filename tute1_3c.png
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\end_deeper
|
||||
\begin_layout Enumerate
|
||||
Select the
|
||||
\emph on
|
||||
Label
|
||||
\emph default
|
||||
node in the
|
||||
\emph on
|
||||
Scene Tree
|
||||
\emph default
|
||||
(if it's not selected yet), the properties of the selected node will appear
|
||||
in the
|
||||
\emph on
|
||||
Property Editor
|
||||
\end_layout
|
||||
|
||||
\begin_deeper
|
||||
\begin_layout Standard
|
||||
\align center
|
||||
\begin_inset Graphics
|
||||
filename tute1_3a.png
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\align center
|
||||
\begin_inset Graphics
|
||||
filename tute1_3b.png
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\end_deeper
|
||||
\begin_layout Enumerate
|
||||
Look for the
|
||||
\emph on
|
||||
Text
|
||||
\emph default
|
||||
property in the
|
||||
\emph on
|
||||
Property Editor
|
||||
\emph default
|
||||
and click the right column, so it becomes editable.
|
||||
Enter the text
|
||||
\begin_inset Quotes eld
|
||||
\end_inset
|
||||
|
||||
Hello, World!
|
||||
\begin_inset Quotes erd
|
||||
\end_inset
|
||||
|
||||
.
|
||||
A red square containing
|
||||
\begin_inset Quotes eld
|
||||
\end_inset
|
||||
|
||||
Hello World!
|
||||
\begin_inset Quotes erd
|
||||
\end_inset
|
||||
|
||||
will appear at the top left, move it to the center.
|
||||
\end_layout
|
||||
|
||||
\begin_deeper
|
||||
\begin_layout Standard
|
||||
\align center
|
||||
\begin_inset Graphics
|
||||
filename tute1_4a.png
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\align center
|
||||
\begin_inset Graphics
|
||||
filename tute1_4b.png
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\end_deeper
|
||||
\begin_layout Enumerate
|
||||
Save the scene.
|
||||
\end_layout
|
||||
|
||||
\begin_deeper
|
||||
\begin_layout Standard
|
||||
\align center
|
||||
\begin_inset Graphics
|
||||
filename tute1_5a.png
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\align center
|
||||
\begin_inset Graphics
|
||||
filename tute1_5b.png
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\end_deeper
|
||||
\begin_layout Enumerate
|
||||
Press PLAY.
|
||||
A new window will appear running the application.
|
||||
\end_layout
|
||||
|
||||
\begin_deeper
|
||||
\begin_layout Standard
|
||||
\align center
|
||||
\begin_inset Graphics
|
||||
filename tute1_6.png
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\align center
|
||||
\begin_inset Graphics
|
||||
filename tute1_7.png
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\end_deeper
|
||||
\begin_layout Subsubsection*
|
||||
Hello World 2 (a little more complex)
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsubsection*
|
||||
A 3D Cube in Space
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
In many cases, nodes and other types of engine objects need to express changes
|
||||
in their state, such as a button being pressed, a scroll being dragged,
|
||||
or a projectile colliding against a tank.
|
||||
Godot Engine utilizes the concept of signals for this.
|
||||
Different types of nodes and objects can emit signals, and any other node
|
||||
or object can connect to them.
|
||||
|
||||
\end_layout
|
||||
|
||||
\end_body
|
||||
\end_document
|
Before Width: | Height: | Size: 79 KiB |
Before Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 1.4 KiB |
|
@ -1,25 +0,0 @@
|
|||
undo/redo api proposal
|
||||
|
||||
|
||||
|
||||
o o o o o o o o
|
||||
|
||||
|
||||
undoredo.create_method();
|
||||
undoredo.add_do_method(node,"add_child",node_to_add);
|
||||
undoredo.add_undo_method(node,"remove_child",node_to_add);
|
||||
undoredo.add_add_data(node_to_add);
|
||||
undoredo.commit()
|
||||
|
||||
undoredo.create_method();
|
||||
undoredo.add_do_method(node,"remove_node",node_to_remove);
|
||||
undoredo.add_undo_method(node,"add_node",node_to_remove);
|
||||
undoredo.add_remove_data(node_to_remove);
|
||||
undoredo.commit()
|
||||
|
||||
|
||||
undoredo.create_property();
|
||||
undoredo.add_do_set(node,"property",value);
|
||||
undoredo.add_undo_set(node,"property",previous_value);
|
||||
undoredo.add_remove_data(node_to_remove);
|
||||
undoredo.commit()
|
|
@ -479,6 +479,13 @@ Error StreamPeerOpenSSL::get_partial_data(uint8_t* p_buffer, int p_bytes,int &r_
|
|||
return OK;
|
||||
}
|
||||
|
||||
int StreamPeerOpenSSL::get_available_bytes() const {
|
||||
|
||||
ERR_FAIL_COND_V(!connected,0);
|
||||
|
||||
return SSL_pending(ssl);
|
||||
|
||||
}
|
||||
StreamPeerOpenSSL::StreamPeerOpenSSL() {
|
||||
|
||||
ctx=NULL;
|
||||
|
|
|
@ -71,6 +71,8 @@ public:
|
|||
virtual Error get_data(uint8_t* p_buffer, int p_bytes);
|
||||
virtual Error get_partial_data(uint8_t* p_buffer, int p_bytes,int &r_received);
|
||||
|
||||
virtual int get_available_bytes() const;
|
||||
|
||||
static void initialize_ssl();
|
||||
static void finalize_ssl();
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include <string.h>
|
||||
#include <netdb.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#ifndef NO_FCNTL
|
||||
#ifdef __HAIKU__
|
||||
#include <fcntl.h>
|
||||
|
@ -367,6 +368,14 @@ Error StreamPeerTCPPosix::get_partial_data(uint8_t* p_buffer, int p_bytes,int &r
|
|||
return read(p_buffer, p_bytes, r_received, false);
|
||||
};
|
||||
|
||||
int StreamPeerTCPPosix::get_available_bytes() const {
|
||||
|
||||
unsigned long len;
|
||||
int ret = ioctl(sockfd,FIONREAD,&len);
|
||||
ERR_FAIL_COND_V(ret==-1,0)
|
||||
return len;
|
||||
|
||||
}
|
||||
IP_Address StreamPeerTCPPosix::get_connected_host() const {
|
||||
|
||||
return peer_host;
|
||||
|
|
|
@ -67,6 +67,8 @@ public:
|
|||
virtual Error get_data(uint8_t* p_buffer, int p_bytes);
|
||||
virtual Error get_partial_data(uint8_t* p_buffer, int p_bytes,int &r_received);
|
||||
|
||||
virtual int get_available_bytes() const;
|
||||
|
||||
void set_socket(int p_sockfd, IP_Address p_host, int p_port);
|
||||
|
||||
virtual IP_Address get_connected_host() const;
|
||||
|
|
BIN
logo_small.png
Before Width: | Height: | Size: 2.0 KiB |
|
@ -1 +0,0 @@
|
|||
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" && c:\python27\scons p=windows target=debug_release tools=no
|
|
@ -1307,7 +1307,7 @@ MethodInfo GDFunctions::get_info(Function p_func) {
|
|||
} break;
|
||||
case STR_TO_VAR: {
|
||||
|
||||
MethodInfo mi("str2var:var",PropertyInfo(Variant::STRING,"string"));
|
||||
MethodInfo mi("str2var:Variant",PropertyInfo(Variant::STRING,"string"));
|
||||
mi.return_val.type=Variant::NIL;
|
||||
return mi;
|
||||
} break;
|
||||
|
@ -1338,7 +1338,7 @@ MethodInfo GDFunctions::get_info(Function p_func) {
|
|||
} break;
|
||||
case HASH: {
|
||||
|
||||
MethodInfo mi("hash",PropertyInfo(Variant::NIL,"var:var"));
|
||||
MethodInfo mi("hash",PropertyInfo(Variant::NIL,"var:Variant"));
|
||||
mi.return_val.type=Variant::INT;
|
||||
return mi;
|
||||
} break;
|
||||
|
|
|
@ -1370,7 +1370,7 @@ Variant GDFunctionState::resume(const Variant& p_arg) {
|
|||
|
||||
void GDFunctionState::_bind_methods() {
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("resume:var","arg"),&GDFunctionState::resume,DEFVAL(Variant()));
|
||||
ObjectTypeDB::bind_method(_MD("resume:Variant","arg"),&GDFunctionState::resume,DEFVAL(Variant()));
|
||||
ObjectTypeDB::bind_method(_MD("is_valid"),&GDFunctionState::is_valid);
|
||||
ObjectTypeDB::bind_native_method(METHOD_FLAGS_DEFAULT,"_signal_callback",&GDFunctionState::_signal_callback,MethodInfo("_signal_callback"));
|
||||
|
||||
|
|
|
@ -342,6 +342,14 @@ void StreamPeerWinsock::set_nodelay(bool p_enabled) {
|
|||
setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (char*)&flag, sizeof(int));
|
||||
}
|
||||
|
||||
int StreamPeerWinsock::get_available_bytes() const {
|
||||
|
||||
unsigned long len;
|
||||
int ret = ioctlsocket(sockfd,FIONREAD,&len);
|
||||
ERR_FAIL_COND_V(ret==-1,0)
|
||||
return len;
|
||||
|
||||
}
|
||||
|
||||
IP_Address StreamPeerWinsock::get_connected_host() const {
|
||||
|
||||
|
|
|
@ -66,6 +66,8 @@ public:
|
|||
virtual Error get_data(uint8_t* p_buffer, int p_bytes);
|
||||
virtual Error get_partial_data(uint8_t* p_buffer, int p_bytes,int &r_received);
|
||||
|
||||
virtual int get_available_bytes() const;
|
||||
|
||||
void set_socket(int p_sockfd, IP_Address p_host, int p_port);
|
||||
|
||||
virtual IP_Address get_connected_host() const;
|
||||
|
|
|
@ -709,7 +709,7 @@ void CanvasItem::draw_circle(const Point2& p_pos, float p_radius, const Color& p
|
|||
|
||||
}
|
||||
|
||||
void CanvasItem::draw_texture(const Ref<Texture>& p_texture,const Point2& p_pos) {
|
||||
void CanvasItem::draw_texture(const Ref<Texture>& p_texture,const Point2& p_pos,const Color& p_modulate) {
|
||||
|
||||
if (!drawing) {
|
||||
ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.");
|
||||
|
@ -718,7 +718,7 @@ void CanvasItem::draw_texture(const Ref<Texture>& p_texture,const Point2& p_pos)
|
|||
|
||||
ERR_FAIL_COND(p_texture.is_null());
|
||||
|
||||
p_texture->draw(canvas_item,p_pos);
|
||||
p_texture->draw(canvas_item,p_pos,p_modulate);
|
||||
}
|
||||
|
||||
void CanvasItem::draw_texture_rect(const Ref<Texture>& p_texture,const Rect2& p_rect, bool p_tile,const Color& p_modulate, bool p_transpose) {
|
||||
|
|
|
@ -211,7 +211,7 @@ public:
|
|||
void draw_line(const Point2& p_from, const Point2& p_to,const Color& p_color,float p_width=1.0);
|
||||
void draw_rect(const Rect2& p_rect, const Color& p_color);
|
||||
void draw_circle(const Point2& p_pos, float p_radius, const Color& p_color);
|
||||
void draw_texture(const Ref<Texture>& p_texture,const Point2& p_pos);
|
||||
void draw_texture(const Ref<Texture>& p_texture, const Point2& p_pos, const Color &p_modulate=Color(1,1,1,1));
|
||||
void draw_texture_rect(const Ref<Texture>& p_texture, const Rect2& p_rect, bool p_tile=false,const Color& p_modulate=Color(1,1,1), bool p_transpose=false);
|
||||
void draw_texture_rect_region(const Ref<Texture>& p_texture,const Rect2& p_rect, const Rect2& p_src_rect,const Color& p_modulate=Color(1,1,1), bool p_transpose=false);
|
||||
void draw_style_box(const Ref<StyleBox>& p_style_box,const Rect2& p_rect);
|
||||
|
|
|
@ -50,9 +50,9 @@ void Slider::_input_event(InputEvent p_event) {
|
|||
grab.pos=orientation==VERTICAL?mb.y:mb.x;
|
||||
double max = orientation==VERTICAL ? get_size().height : get_size().width ;
|
||||
if (orientation==VERTICAL)
|
||||
set_val( ( ( -(double)grab.pos / max) * ( get_max() - get_min() ) ) + get_max() );
|
||||
set_unit_value( 1 - ((double)grab.pos / max) );
|
||||
else
|
||||
set_val( ( ( (double)grab.pos / max) * ( get_max() - get_min() ) ) + get_min() );
|
||||
set_unit_value((double)grab.pos / max);
|
||||
grab.active=true;
|
||||
grab.uvalue=get_unit_value();
|
||||
} else {
|
||||
|
|
|
@ -74,6 +74,7 @@ Size2 Tabs::get_minimum_size() const {
|
|||
}
|
||||
}
|
||||
|
||||
ms.width=0; //should make this optional
|
||||
return ms;
|
||||
}
|
||||
|
||||
|
@ -85,6 +86,23 @@ void Tabs::_input_event(const InputEvent& p_event) {
|
|||
|
||||
Point2 pos( p_event.mouse_motion.x, p_event.mouse_motion.y );
|
||||
|
||||
hilite_arrow=-1;
|
||||
if (buttons_visible) {
|
||||
|
||||
Ref<Texture> incr = get_icon("increment");
|
||||
Ref<Texture> decr = get_icon("decrement");
|
||||
|
||||
int limit=get_size().width-incr->get_width()-decr->get_width();
|
||||
|
||||
if (pos.x>limit+decr->get_width()) {
|
||||
hilite_arrow=1;
|
||||
} else if (pos.x>limit) {
|
||||
hilite_arrow=0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
int hover_buttons=-1;
|
||||
hover=-1;
|
||||
for(int i=0;i<tabs.size();i++) {
|
||||
|
@ -163,9 +181,34 @@ void Tabs::_input_event(const InputEvent& p_event) {
|
|||
// clicks
|
||||
Point2 pos( p_event.mouse_button.x, p_event.mouse_button.y );
|
||||
|
||||
if (buttons_visible) {
|
||||
|
||||
Ref<Texture> incr = get_icon("increment");
|
||||
Ref<Texture> decr = get_icon("decrement");
|
||||
|
||||
int limit=get_size().width-incr->get_width()-decr->get_width();
|
||||
|
||||
if (pos.x>limit+decr->get_width()) {
|
||||
if (missing_right) {
|
||||
offset++;
|
||||
update();
|
||||
}
|
||||
return;
|
||||
} else if (pos.x>limit) {
|
||||
if (offset>0) {
|
||||
offset--;
|
||||
update();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int found=-1;
|
||||
for(int i=0;i<tabs.size();i++) {
|
||||
|
||||
if (i<offset)
|
||||
continue;
|
||||
if (tabs[i].rb_rect.has_point(pos)) {
|
||||
rb_pressing=true;
|
||||
update();
|
||||
|
@ -225,7 +268,46 @@ void Tabs::_notification(int p_what) {
|
|||
|
||||
int w=0;
|
||||
|
||||
int mw = get_minimum_size().width;
|
||||
int mw = 0;
|
||||
|
||||
{
|
||||
|
||||
|
||||
// h+=MIN( get_constant("label_valign_fg"), get_constant("label_valign_bg") );
|
||||
|
||||
for(int i=0;i<tabs.size();i++) {
|
||||
|
||||
Ref<Texture> tex = tabs[i].icon;
|
||||
if (tex.is_valid()) {
|
||||
if (tabs[i].text!="")
|
||||
mw+=get_constant("hseparation");
|
||||
|
||||
}
|
||||
mw+=font->get_string_size(tabs[i].text).width;
|
||||
if (current==i)
|
||||
mw+=tab_fg->get_minimum_size().width;
|
||||
else
|
||||
mw+=tab_bg->get_minimum_size().width;
|
||||
|
||||
if (tabs[i].right_button.is_valid()) {
|
||||
Ref<Texture> rb=tabs[i].right_button;
|
||||
Size2 bms = rb->get_size();//+get_stylebox("button")->get_minimum_size();
|
||||
bms.width+=get_constant("hseparation");
|
||||
|
||||
mw+=bms.width;
|
||||
}
|
||||
|
||||
if (tabs[i].close_button.is_valid()) {
|
||||
Ref<Texture> cb=tabs[i].close_button;
|
||||
Size2 bms = cb->get_size();//+get_stylebox("button")->get_minimum_size();
|
||||
bms.width+=get_constant("hseparation");
|
||||
mw+=bms.width;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (tab_align==ALIGN_CENTER) {
|
||||
w=(get_size().width-mw)/2;
|
||||
|
@ -238,8 +320,19 @@ void Tabs::_notification(int p_what) {
|
|||
w=0;
|
||||
}
|
||||
|
||||
Ref<Texture> incr = get_icon("increment");
|
||||
Ref<Texture> decr = get_icon("decrement");
|
||||
Ref<Texture> incr_hl = get_icon("increment_hilite");
|
||||
Ref<Texture> decr_hl = get_icon("decrement_hilite");
|
||||
|
||||
int limit=get_size().width - incr->get_size().width - decr->get_size().width;
|
||||
|
||||
missing_right=false;
|
||||
|
||||
for(int i=0;i<tabs.size();i++) {
|
||||
|
||||
if (i<offset)
|
||||
continue;
|
||||
tabs[i].ofs_cache=w;
|
||||
|
||||
String s = tabs[i].text;
|
||||
|
@ -247,6 +340,8 @@ void Tabs::_notification(int p_what) {
|
|||
int slen=font->get_string_size(s).width;
|
||||
lsize+=slen;
|
||||
|
||||
|
||||
|
||||
Ref<Texture> icon;
|
||||
if (tabs[i].icon.is_valid()) {
|
||||
icon = tabs[i].icon;
|
||||
|
@ -319,6 +414,16 @@ void Tabs::_notification(int p_what) {
|
|||
}
|
||||
|
||||
|
||||
if (w+lsize > limit) {
|
||||
max_drawn_tab=i-1;
|
||||
missing_right=true;
|
||||
break;
|
||||
} else {
|
||||
max_drawn_tab=i;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Ref<StyleBox> sb;
|
||||
int va;
|
||||
Color col;
|
||||
|
@ -484,6 +589,25 @@ void Tabs::_notification(int p_what) {
|
|||
|
||||
}
|
||||
|
||||
if (offset>0 || missing_right) {
|
||||
|
||||
int vofs = (get_size().height-incr->get_size().height)/2;
|
||||
|
||||
if (offset>0)
|
||||
draw_texture(hilite_arrow==0?decr_hl:decr,Point2(limit,vofs));
|
||||
else
|
||||
draw_texture(decr,Point2(limit,vofs),Color(1,1,1,0.5));
|
||||
|
||||
if (missing_right)
|
||||
draw_texture(hilite_arrow==1?incr_hl:incr,Point2(limit+decr->get_size().width,vofs));
|
||||
else
|
||||
draw_texture(incr,Point2(limit+decr->get_size().width,vofs),Color(1,1,1,0.5));
|
||||
|
||||
buttons_visible=true;
|
||||
} else {
|
||||
buttons_visible=false;
|
||||
}
|
||||
|
||||
|
||||
} break;
|
||||
}
|
||||
|
@ -673,8 +797,11 @@ Tabs::Tabs() {
|
|||
tab_align=ALIGN_CENTER;
|
||||
rb_hover=-1;
|
||||
rb_pressing=false;
|
||||
hilite_arrow=-1;
|
||||
|
||||
cb_hover=-1;
|
||||
cb_pressing=false;
|
||||
cb_displaypolicy = SHOW_NEVER; // Default : no close button
|
||||
offset=0;
|
||||
max_drawn_tab=0;
|
||||
}
|
||||
|
|
|
@ -65,6 +65,12 @@ private:
|
|||
Rect2 cb_rect;
|
||||
};
|
||||
|
||||
|
||||
int offset;
|
||||
int max_drawn_tab;
|
||||
int hilite_arrow;
|
||||
bool buttons_visible;
|
||||
bool missing_right;
|
||||
Vector<Tab> tabs;
|
||||
int current;
|
||||
Control *_get_tab(int idx) const;
|
||||
|
|
|
@ -1721,6 +1721,7 @@ void Tree::text_editor_enter(String p_text) {
|
|||
|
||||
|
||||
text_editor->hide();
|
||||
value_editor->hide();
|
||||
|
||||
if (!popup_edited_item)
|
||||
return;
|
||||
|
@ -2167,18 +2168,9 @@ void Tree::_input_event(InputEvent p_event) {
|
|||
range_drag_enabled=false;
|
||||
Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_VISIBLE);
|
||||
warp_mouse(range_drag_capture_pos);
|
||||
} else {
|
||||
text_editor->set_pos(pressing_item_rect.pos);
|
||||
text_editor->set_size(pressing_item_rect.size);
|
||||
} else
|
||||
edit_selected();
|
||||
|
||||
text_editor->clear();
|
||||
text_editor->set_text( pressing_for_editor_text );
|
||||
text_editor->select_all();
|
||||
|
||||
text_editor->show_modal();
|
||||
text_editor->grab_focus();
|
||||
|
||||
}
|
||||
pressing_for_editor=false;
|
||||
|
||||
}
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
|
||||
#include "servers/physics_2d_server.h"
|
||||
#include "servers/visual_server.h"
|
||||
#include "geometry.h"
|
||||
|
||||
void ConvexPolygonShape2D::_update_shape() {
|
||||
|
||||
Physics2DServer::get_singleton()->shape_set_data(get_rid(),points);
|
||||
|
@ -40,7 +42,9 @@ void ConvexPolygonShape2D::_update_shape() {
|
|||
void ConvexPolygonShape2D::set_point_cloud(const Vector<Vector2>& p_points) {
|
||||
|
||||
|
||||
|
||||
Vector<Point2> hull=Geometry::convex_hull_2d(p_points);
|
||||
ERR_FAIL_COND(hull.size()<3);
|
||||
set_points(hull);
|
||||
}
|
||||
|
||||
void ConvexPolygonShape2D::set_points(const Vector<Vector2>& p_points) {
|
||||
|
|
|
@ -709,6 +709,10 @@ void make_default_theme() {
|
|||
t->set_stylebox("button_pressed","Tabs", make_stylebox( button_pressed_png,4,4,4,4) );
|
||||
t->set_stylebox("button","Tabs", make_stylebox( button_normal_png,4,4,4,4) );
|
||||
|
||||
t->set_icon("increment","Tabs",make_icon( scroll_button_right_png));
|
||||
t->set_icon("increment_hilite","Tabs",make_icon( scroll_button_right_hl_png));
|
||||
t->set_icon("decrement","Tabs",make_icon( scroll_button_left_png));
|
||||
t->set_icon("decrement_hilite","Tabs",make_icon( scroll_button_left_hl_png));
|
||||
|
||||
t->set_font("font","Tabs", default_font );
|
||||
|
||||
|
|
|
@ -572,8 +572,8 @@ void ShaderMaterial::_bind_methods() {
|
|||
ObjectTypeDB::bind_method(_MD("set_shader","shader:Shader"), &ShaderMaterial::set_shader );
|
||||
ObjectTypeDB::bind_method(_MD("get_shader:Shader"), &ShaderMaterial::get_shader );
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("set_shader_param","param","value:var"), &ShaderMaterial::set_shader_param);
|
||||
ObjectTypeDB::bind_method(_MD("get_shader_param:var","param"), &ShaderMaterial::get_shader_param);
|
||||
ObjectTypeDB::bind_method(_MD("set_shader_param","param","value:Variant"), &ShaderMaterial::set_shader_param);
|
||||
ObjectTypeDB::bind_method(_MD("get_shader_param:Variant","param"), &ShaderMaterial::get_shader_param);
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("_shader_changed"), &ShaderMaterial::_shader_changed );
|
||||
}
|
||||
|
|
|
@ -1537,6 +1537,7 @@ void SceneState::add_editable_instance(const NodePath& p_path){
|
|||
SceneState::SceneState() {
|
||||
|
||||
base_scene_idx=-1;
|
||||
last_modified_time=0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1596,6 +1597,15 @@ Node *PackedScene::instance(bool p_gen_edit_state) const {
|
|||
return s;
|
||||
}
|
||||
|
||||
void PackedScene::recreate_state() {
|
||||
|
||||
state = Ref<SceneState>( memnew( SceneState ));
|
||||
state->set_path(get_path());
|
||||
#ifdef TOOLS_ENABLED
|
||||
state->set_last_modified_time(get_last_modified_time());
|
||||
#endif
|
||||
}
|
||||
|
||||
Ref<SceneState> PackedScene::get_state() {
|
||||
|
||||
return state;
|
||||
|
@ -1607,6 +1617,7 @@ void PackedScene::set_path(const String& p_path,bool p_take_over) {
|
|||
Resource::set_path(p_path,p_take_over);
|
||||
}
|
||||
|
||||
|
||||
void PackedScene::_bind_methods() {
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("pack","path:Node"),&PackedScene::pack);
|
||||
|
|
|
@ -99,6 +99,8 @@ class SceneState : public Reference {
|
|||
|
||||
String path;
|
||||
|
||||
uint64_t last_modified_time;
|
||||
|
||||
_FORCE_INLINE_ Ref<SceneState> _get_base_scene_state() const;
|
||||
|
||||
static bool disable_placeholders;
|
||||
|
@ -162,6 +164,9 @@ public:
|
|||
void add_connection(int p_from,int p_to, int p_signal, int p_method, int p_flags,const Vector<int>& p_binds);
|
||||
void add_editable_instance(const NodePath& p_path);
|
||||
|
||||
virtual void set_last_modified_time(uint64_t p_time) { last_modified_time=p_time; }
|
||||
uint64_t get_last_modified_time() const { return last_modified_time; }
|
||||
|
||||
|
||||
SceneState();
|
||||
};
|
||||
|
@ -189,8 +194,13 @@ public:
|
|||
bool can_instance() const;
|
||||
Node *instance(bool p_gen_edit_state=false) const;
|
||||
|
||||
virtual void set_path(const String& p_path,bool p_take_over=false);
|
||||
void recreate_state();
|
||||
|
||||
virtual void set_path(const String& p_path,bool p_take_over=false);
|
||||
#ifdef TOOLS_ENABLED
|
||||
virtual void set_last_modified_time(uint64_t p_time) { state->set_last_modified_time(p_time); }
|
||||
|
||||
#endif
|
||||
Ref<SceneState> get_state();
|
||||
|
||||
PackedScene();
|
||||
|
|
|
@ -260,7 +260,7 @@ void ShaderGraph::_bind_methods() {
|
|||
ObjectTypeDB::bind_method(_MD("clear","shader_type"),&ShaderGraph::clear);
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("node_set_state","shader_type","id","state"),&ShaderGraph::node_set_state);
|
||||
ObjectTypeDB::bind_method(_MD("node_get_state:var","shader_type","id"),&ShaderGraph::node_get_state);
|
||||
ObjectTypeDB::bind_method(_MD("node_get_state:Variant","shader_type","id"),&ShaderGraph::node_get_state);
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("_set_data"),&ShaderGraph::_set_data);
|
||||
ObjectTypeDB::bind_method(_MD("_get_data"),&ShaderGraph::_get_data);
|
||||
|
|
|
@ -108,8 +108,8 @@ void Shape2D::_bind_methods() {
|
|||
ObjectTypeDB::bind_method(_MD("get_custom_solver_bias"),&Shape2D::get_custom_solver_bias);
|
||||
ObjectTypeDB::bind_method(_MD("collide","local_xform","with_shape:Shape2D","shape_xform"),&Shape2D::collide);
|
||||
ObjectTypeDB::bind_method(_MD("collide_with_motion","local_xform","local_motion","with_shape:Shape2D","shape_xform","shape_motion"),&Shape2D::collide_with_motion);
|
||||
ObjectTypeDB::bind_method(_MD("collide_and_get_contacts:var","local_xform","with_shape:Shape2D","shape_xform"),&Shape2D::collide_and_get_contacts);
|
||||
ObjectTypeDB::bind_method(_MD("collide_with_motion_and_get_contacts:var","local_xform","local_motion","with_shape:Shape2D","shape_xform","shape_motion"),&Shape2D::collide_with_motion_and_get_contacts);
|
||||
ObjectTypeDB::bind_method(_MD("collide_and_get_contacts:Variant","local_xform","with_shape:Shape2D","shape_xform"),&Shape2D::collide_and_get_contacts);
|
||||
ObjectTypeDB::bind_method(_MD("collide_with_motion_and_get_contacts:Variant","local_xform","local_motion","with_shape:Shape2D","shape_xform","shape_motion"),&Shape2D::collide_with_motion_and_get_contacts);
|
||||
|
||||
ADD_PROPERTY( PropertyInfo(Variant::REAL,"custom_solver_bias",PROPERTY_HINT_RANGE,"0,1,0.001"),_SCS("set_custom_solver_bias"),_SCS("get_custom_solver_bias"));
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ void Physics2DDirectBodyState::_bind_methods() {
|
|||
ObjectTypeDB::bind_method(_MD("get_contact_collider_id","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_id);
|
||||
ObjectTypeDB::bind_method(_MD("get_contact_collider_object","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_object);
|
||||
ObjectTypeDB::bind_method(_MD("get_contact_collider_shape","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_shape);
|
||||
ObjectTypeDB::bind_method(_MD("get_contact_collider_shape_metadata:var","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_shape_metadata);
|
||||
ObjectTypeDB::bind_method(_MD("get_contact_collider_shape_metadata:Variant","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_shape_metadata);
|
||||
ObjectTypeDB::bind_method(_MD("get_contact_collider_velocity_at_pos","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_velocity_at_pos);
|
||||
ObjectTypeDB::bind_method(_MD("get_step"),&Physics2DDirectBodyState::get_step);
|
||||
ObjectTypeDB::bind_method(_MD("integrate_forces"),&Physics2DDirectBodyState::integrate_forces);
|
||||
|
|
|
@ -187,14 +187,13 @@ void DocData::generate(bool p_basic_types) {
|
|||
|
||||
|
||||
arginfo=E->get().return_val;
|
||||
if (arginfo.type==Variant::NIL)
|
||||
continue;
|
||||
#ifdef DEBUG_METHODS_ENABLED
|
||||
if (m && m->get_return_type()!=StringName())
|
||||
method.return_type=m->get_return_type();
|
||||
else
|
||||
else if (arginfo.type!=Variant::NIL) {
|
||||
#endif
|
||||
method.return_type=(arginfo.hint==PROPERTY_HINT_RESOURCE_TYPE)?arginfo.hint_string:Variant::get_type_name(arginfo.type);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
|
|
|
@ -1,146 +0,0 @@
|
|||
BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV, SPAN {
|
||||
font-family: Arial, Geneva, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
a {
|
||||
|
||||
text-decoration: none;
|
||||
|
||||
}
|
||||
|
||||
a:hover {
|
||||
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
td.top_table {
|
||||
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
div.method_doc {
|
||||
|
||||
padding-bottom: 30px;
|
||||
}
|
||||
|
||||
div.method_description {
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
list.inh_class_list {
|
||||
margin-left: 30px;
|
||||
|
||||
}
|
||||
|
||||
div.inh_class_list {
|
||||
margin-left: 30px;
|
||||
|
||||
}
|
||||
|
||||
div.method_doc div.method {
|
||||
|
||||
font-size: 12pt;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
span.funcdecl {
|
||||
|
||||
color: #202060;
|
||||
}
|
||||
|
||||
span.funcdef {
|
||||
|
||||
color: #202060;
|
||||
}
|
||||
|
||||
|
||||
span.qualifier {
|
||||
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
span.symbol {
|
||||
|
||||
/*font-weight: bold;*/
|
||||
color: #471870;
|
||||
}
|
||||
|
||||
|
||||
span.datatype {
|
||||
|
||||
color: #6a1533;
|
||||
}
|
||||
|
||||
tr.category_title {
|
||||
|
||||
background-color: #333333;
|
||||
}
|
||||
a.category_title {
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
div.method_list {
|
||||
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
div.constant_list {
|
||||
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
div.member_list {
|
||||
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
div.description {
|
||||
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
div.class_description {
|
||||
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
div.method_list li div {
|
||||
|
||||
display: inline;
|
||||
}
|
||||
|
||||
div.member_list li div.member {
|
||||
|
||||
display: inline;
|
||||
}
|
||||
|
||||
div.constant_list li div.constant {
|
||||
|
||||
display: inline;
|
||||
}
|
||||
|
||||
span.member_description {
|
||||
|
||||
font-style: italic;
|
||||
color: grey;
|
||||
}
|
||||
|
||||
span.constant_description {
|
||||
|
||||
font-style: italic;
|
||||
color: grey;
|
||||
}
|
||||
|
||||
span.identifier {
|
||||
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
table.class_table td {
|
||||
|
||||
vertical-align: top;
|
||||
}
|
||||
|
|
@ -209,6 +209,15 @@ void ArrayPropertyEdit::edit(Object* p_obj,const StringName& p_prop,Variant::Typ
|
|||
|
||||
}
|
||||
|
||||
Node *ArrayPropertyEdit::get_node() {
|
||||
|
||||
Object *o = ObjectDB::get_instance(obj);
|
||||
if (!o)
|
||||
return NULL;
|
||||
|
||||
return o->cast_to<Node>();
|
||||
}
|
||||
|
||||
void ArrayPropertyEdit::_bind_methods() {
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("_set_size"),&ArrayPropertyEdit::_set_size);
|
||||
|
|
|
@ -30,6 +30,8 @@ public:
|
|||
|
||||
void edit(Object* p_obj, const StringName& p_prop, Variant::Type p_deftype);
|
||||
|
||||
Node *get_node();
|
||||
|
||||
ArrayPropertyEdit();
|
||||
};
|
||||
|
||||
|
|
|
@ -31,6 +31,9 @@
|
|||
#include "editor_settings.h"
|
||||
#include "os/dir_access.h"
|
||||
#include "io/resource_loader.h"
|
||||
#include "scene/resources/packed_scene.h"
|
||||
#include "os/file_access.h"
|
||||
#include "editor_node.h"
|
||||
|
||||
void EditorHistory::_cleanup_history() {
|
||||
|
||||
|
@ -493,6 +496,93 @@ void EditorData::remove_scene(int p_idx){
|
|||
edited_scene.remove(p_idx);
|
||||
|
||||
}
|
||||
|
||||
bool EditorData::_find_updated_instances(Node* p_root,Node *p_node,Set<String> &checked_paths) {
|
||||
|
||||
if (p_root!=p_node && p_node->get_owner()!=p_root && !p_root->is_editable_instance(p_node->get_owner()))
|
||||
return false;
|
||||
|
||||
Ref<SceneState> ss;
|
||||
|
||||
if (p_node==p_root) {
|
||||
ss=p_node->get_scene_inherited_state();
|
||||
} else if (p_node->get_filename()!=String()){
|
||||
ss=p_node->get_scene_instance_state();
|
||||
}
|
||||
|
||||
if (ss.is_valid()) {
|
||||
String path = ss->get_path();
|
||||
|
||||
if (!checked_paths.has(path)) {
|
||||
|
||||
uint64_t modified_time = FileAccess::get_modified_time(path);
|
||||
if (modified_time!=ss->get_last_modified_time()) {
|
||||
return true; //external scene changed
|
||||
}
|
||||
|
||||
checked_paths.insert(path);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for(int i=0;i<p_node->get_child_count();i++) {
|
||||
|
||||
bool found = _find_updated_instances(p_root,p_node->get_child(i),checked_paths);
|
||||
if (found)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool EditorData::check_and_update_scene(int p_idx) {
|
||||
|
||||
ERR_FAIL_INDEX_V(p_idx,edited_scene.size(),false);
|
||||
if (!edited_scene[p_idx].root)
|
||||
return false;
|
||||
|
||||
Set<String> checked_scenes;
|
||||
|
||||
|
||||
bool must_reload = _find_updated_instances(edited_scene[p_idx].root,edited_scene[p_idx].root,checked_scenes);
|
||||
|
||||
if (must_reload) {
|
||||
Ref<PackedScene> pscene;
|
||||
pscene.instance();
|
||||
|
||||
EditorProgress ep("update_scene","Updating Scene",2);
|
||||
ep.step("Storing local changes..",0);
|
||||
//pack first, so it stores diffs to previous version of saved scene
|
||||
Error err = pscene->pack(edited_scene[p_idx].root);
|
||||
ERR_FAIL_COND_V(err!=OK,false);
|
||||
ep.step("Updating scene..",1);
|
||||
Node *new_scene = pscene->instance(true);
|
||||
ERR_FAIL_COND_V(!new_scene,false);
|
||||
|
||||
//transfer selection
|
||||
List<Node*> new_selection;
|
||||
for (List<Node*>::Element *E=edited_scene[p_idx].selection.front();E;E=E->next()) {
|
||||
NodePath p = edited_scene[p_idx].root->get_path_to(E->get());
|
||||
Node *new_node = new_scene->get_node(p);
|
||||
if (new_node)
|
||||
new_selection.push_back(new_node);
|
||||
}
|
||||
|
||||
new_scene->set_filename( edited_scene[p_idx].root->get_filename() );
|
||||
|
||||
memdelete(edited_scene[p_idx].root);
|
||||
edited_scene[p_idx].root=new_scene;
|
||||
edited_scene[p_idx].selection=new_selection;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
int EditorData::get_edited_scene() const {
|
||||
|
||||
return current_edited_scene;
|
||||
|
|