SolarPortal wrote:As for the render settings. The blur Width and height allow you to control the glow effect.
You dont want to use a negative exposure..
Is it the emissive of the sun that you are having problems with?
SolarPortal wrote:The camera was fixed in the update from yesterday, so you will be able to use the straight camera and set the orbit property.
SolarPortal wrote:As for the ship movement on the X, yes, it is pretty much the same. However, the order in which you rotate things matters.
I generally store a current pitch and current Yaw which is manipulate through mouse delta.. i know your using the click to move!
Then set the rotation of the ship back to its identity transform using entity.setRotation(obj, 0, 0, 0);
After apply the yaw first, followed by setting the pitch.
Have a look at the plane script found in the "Asset Library\Scripts\Example Scripts\Vehicle\FighterPlaneScript_00.lua"
Q) Is there any way to create a null entity by script? something I can get and set the position and attach to another entities?
SolarPortal wrote:Q) Is there any way to create a null entity by script? something I can get and set the position and attach to another entities?
You could spawn a preset of an empty node and then use this.
We are adding the ability to use custom nodes and attachments soon for the new grouping, attachement and submesh system.
obj = 0
NODE1 = 0
NODE2 = 0
CAM1 = 0
node1_pos = newType.vec3(0,0,0)
node1_rot = newType.vec3(0,0,0)
node2_pos = newType.vec3(0,0,0)
node2_offset = newType.vec3(0,0,20)
cam1_pos = newType.vec3(0,0,0)
cam1_speed = 0.1
mouseDelta = 0
mouseMov = false
mouseDwn = false
pressed_key = 0
-- ==================================================================
function onInit(objID)
obj = objID
end
-- ==================================================================
function postInit()
AttachCam()
end
-- ==================================================================
function onUpdate(timeDelta)
MoveCam()
end
-- ==================================================================
function AttachCam()
NODE1 = entity.spawnPreset("SJ_Empty_node1",node1_pos.x, node1_pos.y, node1_pos.z)
NODE2 = entity.spawnPreset("SJ_Empty_node2",node2_pos.x, node2_pos.y, node2_pos.z)
CAM1 = entity.getIDFromTag("cam_1")
entity.attach(NODE1, NODE2)
entity.setPos(NODE2, node2_offset)
end
-- ==================================================================
function MoveCam()
-- ORBIT
if( input.mouseDown( 2 ) == 1) then
mouseDwn = true
else
mouseDwn = false
end
if ( mouseMov and mouseDwn ) then
entity.yaw( NODE1, -mouseDelta.x, 0 )
entity.pitch( NODE1, -mouseDelta.y, 0 )
end
-- ZOOM
if ( pressed_key == "down" ) then
node2_offset.z = node2_offset.z * 2
entity.setPos( NODE2 , node2_offset )
pressed_key = 0
elseif ( pressed_key == "up" ) then
node2_offset.z = node2_offset.z / 2
entity.setPos( NODE2 , node2_offset )
pressed_key = 0
end
-- LERP
node2_pos.x, node2_pos.y, node2_pos.z = entity.getWorldPosition( NODE2 )
cam1_pos.x, cam1_pos.y, cam1_pos.z = entity.getWorldPosition( CAM1 )
TweenPos(CAM1, cam1_pos, node2_pos, cam1_speed)
end
-- ==================================================================
function onMouseMove()
mouseDelta = newType.vec2(sky.getMouseDelta())
local step = 2
if ( (mouseDelta.x > step or mouseDelta.x < -step) or (mouseDelta.y > step or mouseDelta.y < -step) ) then
mouseMov = true
else
mouseMov = false
end
end
-- ==================================================================
function onKeyDown( key )
pressed_key = key
end
-- ==================================================================
function TweenPos(objectID, currPos, finalPos, speed)
currPos.x = ( finalPos.x - currPos.x ) * speed + currPos.x
currPos.y = ( finalPos.y - currPos.y ) * speed + currPos.y
currPos.z = ( finalPos.z - currPos.z ) * speed + currPos.z
entity.setPos(objectID,currPos)
end
-- ==================================================================
Since I got no response in the other post, I assume that it is an embarrasing feature request.
SolarPortal wrote:As for the ship movement on the X, yes, it is pretty much the same. However, the order in which you rotate things matters.
I generally store a current pitch and current Yaw which is manipulate through mouse delta.. i know your using the click to move!
Then set the rotation of the ship back to its identity transform using entity.setRotation(obj, 0, 0, 0);
After apply the yaw first, followed by setting the pitch.
PitchDeg = entity.getDirection(obj,posID)
cPitch = getPitchLerp(cPitch, PitchDeg.dirX)
entity.turn(obj, cVertTurn * vBoost * timeDelta, 0, cHorTurn * hBoost * timeDelta)
Timedelta is a very important variable. It allows movement and certain programmed actions to move at the same speed depending on whether your game runs at 200fps or 10fps.
SolarPortal wrote:Edit: If its a material error crash when skyline converts the material to .skymat, then could you send us the files to try and fix any faults that show up.
if ( pos.x < 0 or pos.x > screen.x or pos.y < 0 or pos.y > screen.y ) then
outside = true
else
outside = false
end
StarFire wrote:The other question can be done with a raycast from the ship to the object or from the object to the ship depending on what it is you are trying to achieve, and then check the ray results.
Users browsing this forum: No registered users and 3 guests