diff options
author | Juan Linietsky <reduzio@gmail.com> | 2014-10-03 00:10:51 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2014-10-03 00:10:51 -0300 |
commit | b24fe3dd206ce391ec4c5f68d32fc2259f275563 (patch) | |
tree | 5d05b14d21ba1c8a484f9b7f3739a63f42ca082d /demos/3d/truck_town | |
parent | 870c075ebf67749b21b6cc0c705088bbe273f1bb (diff) |
Huge Amount of BugFix
-=-=-=-=-=-=-=-=-=-=-
-Fixes to Collada Exporter (avoid crash situtions)
-Fixed to Collada Importer (Fixed Animation Optimizer Bugs)
-Fixes to RigidBody/RigidBody2D body_enter/body_exit, was buggy
-Fixed ability for RigidBody/RigidBody2D to get contacts reported and bodyin/out in Kinematic mode.
-Added proper trigger support for 3D Physics shapes
-Changed proper value for Z-Offset in OmniLight
-Fixed spot attenuation bug in SpotLight
-Fixed some 3D and 2D spatial soudn bugs related to distance attenuation.
-Fixed bugs in EventPlayer (channels were muted by default)
-Fix in ButtonGroup (get nodes in group are now returned in order)
-Fixed Linear->SRGB Conversion, previous algo sucked, new algo works OK
-Changed SRGB->Linear conversion to use hardware if supported, improves texture quality a lot
-Fixed options for Y-Fov and X-Fov in camera, should be more intuitive.
-Fixed bugs related to viewports and transparency
Huge Amount of New Stuff:
-=-=-=-=-=-=-=-==-=-=-=-
-Ability to manually advance an AnimationPlayer that is inactive (with advance() function)
-More work in WinRT platform
-Added XY normalmap support, imports on this format by default. Reduces normlmap size and enables much nice compression using LATC
-Added Anisotropic filter support to textures, can be specified on import
-Added support for Non-Square, Isometric and Hexagonal tilemaps in TileMap.
-Added Isometric Dungeon demo.
-Added simple hexagonal map demo.
-Added Truck-Town demo. Shows how most types of joints and vehicles are used. Please somebody make a nicer town, this one is too hardcore.
-Added an Object-Picking API to both RigidBody and Area! (and relevant demo)
Diffstat (limited to 'demos/3d/truck_town')
-rw-r--r-- | demos/3d/truck_town/car_base.scn | bin | 0 -> 11573 bytes | |||
-rw-r--r-- | demos/3d/truck_town/cement.tex | bin | 0 -> 169836 bytes | |||
-rw-r--r-- | demos/3d/truck_town/crane.scn | bin | 0 -> 23916 bytes | |||
-rw-r--r-- | demos/3d/truck_town/engine.cfg | 7 | ||||
-rw-r--r-- | demos/3d/truck_town/follow_camera.gd | 69 | ||||
-rw-r--r-- | demos/3d/truck_town/grass.tex | bin | 0 -> 177762 bytes | |||
-rw-r--r-- | demos/3d/truck_town/trailer_truck.scn | bin | 0 -> 19934 bytes | |||
-rw-r--r-- | demos/3d/truck_town/truck_scene.scn | bin | 0 -> 1874193 bytes | |||
-rw-r--r-- | demos/3d/truck_town/trucktown.scn | bin | 0 -> 161749 bytes | |||
-rw-r--r-- | demos/3d/truck_town/vehicle.gd | 54 |
10 files changed, 130 insertions, 0 deletions
diff --git a/demos/3d/truck_town/car_base.scn b/demos/3d/truck_town/car_base.scn Binary files differnew file mode 100644 index 0000000000..d62c8dcb29 --- /dev/null +++ b/demos/3d/truck_town/car_base.scn diff --git a/demos/3d/truck_town/cement.tex b/demos/3d/truck_town/cement.tex Binary files differnew file mode 100644 index 0000000000..a80cde6464 --- /dev/null +++ b/demos/3d/truck_town/cement.tex diff --git a/demos/3d/truck_town/crane.scn b/demos/3d/truck_town/crane.scn Binary files differnew file mode 100644 index 0000000000..080bd8ea17 --- /dev/null +++ b/demos/3d/truck_town/crane.scn diff --git a/demos/3d/truck_town/engine.cfg b/demos/3d/truck_town/engine.cfg new file mode 100644 index 0000000000..8703a251d1 --- /dev/null +++ b/demos/3d/truck_town/engine.cfg @@ -0,0 +1,7 @@ +[application] + +main_scene="res://truck_scene.scn" + +[rasterizer] + +shadow_filter=3 diff --git a/demos/3d/truck_town/follow_camera.gd b/demos/3d/truck_town/follow_camera.gd new file mode 100644 index 0000000000..cf7172d7bb --- /dev/null +++ b/demos/3d/truck_town/follow_camera.gd @@ -0,0 +1,69 @@ + +extends Camera + +# member variables here, example: +# var a=2 +# var b="textvar" + +var collision_exception=[] +export var min_distance=0.5 +export var max_distance=4.0 +export var angle_v_adjust=0.0 +export var autoturn_ray_aperture=25 +export var autoturn_speed=50 +var max_height = 2.0 +var min_height = 0 + +func _fixed_process(dt): + var target = get_parent().get_global_transform().origin + var pos = get_global_transform().origin + var up = Vector3(0,1,0) + + var delta = pos - target + + #regular delta follow + + #check ranges + + if (delta.length() < min_distance): + delta = delta.normalized() * min_distance + elif (delta.length() > max_distance): + delta = delta.normalized() * max_distance + + #check upper and lower height + if ( delta.y > max_height): + delta.y = max_height + if ( delta.y < min_height): + delta.y = min_height + + pos = target + delta + + look_at_from_pos(pos,target,up) + + #turn a little up or down + var t = get_transform() + t.basis = Matrix3(t.basis[0],deg2rad(angle_v_adjust)) * t.basis + set_transform(t) + + + +func _ready(): + +#find collision exceptions for ray + var node = self + while(node): + if (node extends RigidBody): + collision_exception.append(node.get_rid()) + break + else: + node=node.get_parent() + # Initalization here + set_fixed_process(true) + #this detaches the camera transform from the parent spatial node + set_as_toplevel(true) + + + + + + diff --git a/demos/3d/truck_town/grass.tex b/demos/3d/truck_town/grass.tex Binary files differnew file mode 100644 index 0000000000..c28d060697 --- /dev/null +++ b/demos/3d/truck_town/grass.tex diff --git a/demos/3d/truck_town/trailer_truck.scn b/demos/3d/truck_town/trailer_truck.scn Binary files differnew file mode 100644 index 0000000000..0131e9e3a2 --- /dev/null +++ b/demos/3d/truck_town/trailer_truck.scn diff --git a/demos/3d/truck_town/truck_scene.scn b/demos/3d/truck_town/truck_scene.scn Binary files differnew file mode 100644 index 0000000000..8db74a2f7f --- /dev/null +++ b/demos/3d/truck_town/truck_scene.scn diff --git a/demos/3d/truck_town/trucktown.scn b/demos/3d/truck_town/trucktown.scn Binary files differnew file mode 100644 index 0000000000..57a84315ee --- /dev/null +++ b/demos/3d/truck_town/trucktown.scn diff --git a/demos/3d/truck_town/vehicle.gd b/demos/3d/truck_town/vehicle.gd new file mode 100644 index 0000000000..1aa7f0faa2 --- /dev/null +++ b/demos/3d/truck_town/vehicle.gd @@ -0,0 +1,54 @@ + +extends VehicleBody + +# member variables here, example: +# var a=2 +# var b="textvar" + + +const STEER_SPEED=1 +const STEER_LIMIT=0.4 + +var steer_angle=0 +var steer_target=0 + + +export var engine_force=40 + +func _fixed_process(delta): + + + if (Input.is_action_pressed("ui_left")): + steer_target=-STEER_LIMIT + elif (Input.is_action_pressed("ui_right")): + steer_target=STEER_LIMIT + else: + steer_target=0 + + if (Input.is_action_pressed("ui_up")): + set_engine_force(engine_force) + else: + set_engine_force(0) + + if (Input.is_action_pressed("ui_down")): + set_brake(1) + else: + set_brake(0.0) + + + if (steer_target < steer_angle): + steer_angle -= STEER_SPEED*delta + if (steer_target > steer_angle): + steer_angle=steer_target + elif (steer_target > steer_angle): + steer_angle += STEER_SPEED*delta + if (steer_target < steer_angle): + steer_angle=steer_target + + set_steering(steer_angle) +func _ready(): + # Initalization here + set_fixed_process(true) + pass + + |