Commit Graph

37 Commits

Author SHA1 Message Date
Andreas Haas d08092e113 Expose missing Quaternion operators.
Scripts can now evaluate the following cases:
 - (quat * real) and (quat / real)
 - (quat + quat) and (quat - quat)
2016-06-21 23:26:38 +02:00
Dennis Brakhane 1e068d34f4 Add support for Python-like negative indexing
Negative indexing is a useful feature in Python, especially when combined
with array slicing. Array slicing will hopefully be implemented later, but
negative indexing is useful in its own right.

A negative index is indexing from the end of an array,
"array[-1] == array[array.size()-1]", using a negative index
larger/smaller than the length of the array is still an error.

While primarily useful for arrays and strings, support is also added to
"array like" structures like Vector3 and Color. This is done just
to be consistent; vector3[2] is much clearer than vector3[-1], but disallowing
it while allowing it for an array with 3 elements seems confusing.
2016-06-05 20:00:54 +02:00
Dennis Brakhane 842057e56f Move repetitive code to macros
In preparation for the following "allow negative indexing" commit,
replace the repetitive array "set index" and "get index" code with
macros.

no functional changes were made, the resulting machine code is unchanged.
2016-06-05 20:00:54 +02:00
Andreas Haas da3247a500 Make Color.{rgba}8 return int instead float
According to the class doc, these should be int.
Also fixed a little bug: the setter for 'r8' changed the green value
2016-05-31 20:50:19 +02:00
punto- 433de90564 Removing round from int interpolation
This might break some animations that use int tracks in continuous mode, but it should provide a more uniform interpolation for things like sprite frames.
2016-05-17 13:27:49 -03:00
Hubert Jarosz 4a4f247914
remove trailing whitespace 2016-03-09 00:00:52 +01:00
Josh Grams f7fad32188 Variant::blend: add Quat, fix Vector3. 2016-03-08 06:38:19 -05:00
Josh Grams 391ce81c5e AnimationTreePlayer: blend value tracks (closes #2299)
Variant:
- zero() sets a Variant to the appropriate type of zero value
- blend() blends part of one Variant on top of another.
2016-03-01 07:37:36 -05:00
Juan Linietsky 32a6120a5c fixed string operator[], which was broken. Closes #2202 2016-01-02 14:58:27 -03:00
George Marques 5be9ff7b67 Update copyright to 2016 in headers 2016-01-01 11:50:53 -02:00
Juan Linietsky 37f2222dd7 -Added Color8(r8,g8,b8,a8) function as well as .r8,.g8,.b8,.a8 members to Color, to deal with colors in the 0-255 range. Closes #2345 2015-12-31 18:26:49 -03:00
Franklin Sobrinho 6a34ab201a Fix "in" operator, make it use evaluate() instead of operator== 2015-12-11 10:29:55 -03:00
Rémi Verschelde a961347d8c Fix return type of Matrix32 member vars
Thanks to @bojidar-bg for localising the issue.
2015-11-23 19:08:54 +01:00
Juan Linietsky 5dcfdb3435 Merge pull request #2749 from TheHX/fix_string_content_test
Fix String content test
2015-11-18 18:55:01 -03:00
Franklin Sobrinho 541812e999 Implement Quat multiply operator, and xform method 2015-11-11 11:30:55 -03:00
Franklin Sobrinho d5fbd1d262 Fix String content test 2015-11-06 18:52:15 -03:00
Juan Linietsky adb709aa91 -Integers and Float should interpolate on animation, maybe fixes #1891, please test 2015-05-16 18:16:11 -03:00
Juan Linietsky 4804462ee0 -Fixes from source code analyzizer, closes #1768 2015-05-01 10:44:08 -03:00
est31 b2b5143678 Sort xml files, so order is constant
Makes xml format work better with version control systems.
2015-05-01 03:41:45 +02:00
Juan Linietsky 3203a03414 Fixed bug in array comparison, fixes #1712 2015-04-26 12:12:53 -03:00
Juan Linietsky fdaa2920eb Updated copyright year in all headers 2015-04-18 14:38:54 -03:00
Juan Linietsky 22997294fa -Concatenating arrays keeps the shared property if any of the arrays is shared. Fixes #1646 2015-04-07 21:18:46 -03:00
Juan Linietsky 0302ea5b82 Merge pull request #1396 from Spooner/fix_sprintf_errors
Fix sprintf errors
2015-03-22 15:03:32 -03:00
Juan Linietsky a1f715a4da support for 2D shadow casters
Added support for 2D shadow casters.

*DANGER* Shaders in CanvasItem CHANGED, if you are using shader in a
CanvasItem and pull this, you will lose them. Shaders now work through a
2D material system similar to 3D. If you don't want to lose the 2D
shader code, save the shader as a .shd, then create a material in
CanvasItem and re-assign the shader.
2015-03-02 00:54:43 -03:00
Bil Bas (Spooner) db2381de7a Correctly halt on error in sprintf parsing (fixes #1393) 2015-02-19 15:45:49 +00:00
Bil Bas (Spooner) 2c1a3dfed6 Merge branch 'master' of https://github.com/okamstudio/godot into add_sprintf 2015-02-01 20:29:11 +00:00
sanikoyes 317c496f5c Add InputEvent::ACTION get/set support for variant
Add action_press/action_release method bind
2015-01-20 20:01:02 +08:00
Bil Bas (Spooner) 7a41f8c604 Added basic sprintf functionality (e.g. "fish %d %s" % [12, Vector2(1, 2)]) 2015-01-10 20:44:20 +00:00
Juan Linietsky 2144648a3d -fix assignment to vector types in script using integer indices crash (#978) 2015-01-02 15:53:02 -03:00
Juan Linietsky 28daf19744 -assignment of ord to string index made valid #1072 2015-01-02 13:17:46 -03:00
Juan Linietsky 1a2cb755e2 3D Physics and Other Stuff
-=-=-=-=-=-=-=-=-=-=-=-=-=

-New Vehicle (Based on Bullet's RaycastVehicle) - Vehiclebody/VehicleWheel. Demo will come soon, old vehicle (CarBody) will go away soon too.
-A lot of fixes to the 3D physics engine
-Added KinematicBody with demo
-Fixed the space query API for 2D (demo will come soon). 3D is WIP.
-Fixed long-standing bug with body_enter/body_exit for Area and Area2D
-Performance variables now includes physics (active bodies, collision pairs and islands)
-Ability to see what's inside of instanced scenes!
-Fixed Blend Shapes (no bs+skeleton yet)
-Added an Android JavaClassWrapper singleton for using Android native classes directly from GDScript. This is very Alpha!
2014-09-02 23:13:40 -03:00
Juan Linietsky 9ff6d55822 Polygon2D
-=-=-=-=-

Another gift for those who make 2D games:
-Edit polygons, concave or convex, color them, texture them and uv-map them
-Corresponding editor
-Can have a custom pivot, so they are compatible with bones and IK
2014-07-07 17:44:21 -03:00
Juan Linietsky 9b8696d3dd Light Baker!
-=-=-=-=-=-=

-Support for lightmap baker, have fun figuring out how it works before tutorial is published.
2014-06-11 10:41:03 -03:00
marynate 6e1e66878c Fix Variant vector2/vecotor3 multiply bug 2014-03-29 00:06:25 +08:00
Juan Linietsky b2ce682f6e -scripts are converted to bytecode on export
-fix bug in doc where touchscreen events were not documented
2014-02-25 09:31:47 -03:00
Juan Linietsky f2a068984c -run script in editor
-add search docs dialog that returns places string was found
-added flash
2014-02-20 23:01:44 -03:00
Juan Linietsky 0b806ee0fc GODOT IS OPEN SOURCE 2014-02-09 22:10:30 -03:00