SetCameraClip: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
(13 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{Client function}}  
{{Client function}}  
__NOTOC__  
__NOTOC__  
This function ...
This function sets if the camera will "collide" with any objects or vehicles in its way. This means that if object clip is enabled an object is in the way of where the camera actually wants to be, the camera will try to be in front of it. This function can disable that.
{{Note|This function doesn't fix the issue of camera clip not working on objects out of world bounds.}}


==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool setCameraClip ( bool objects, bool vehicles )  
bool setCameraClip ( [ bool objects = true, bool vehicles = true ] )  
</syntaxhighlight>  
</syntaxhighlight>  
{{OOP||[[Camera]].setClip||getCameraClip}}


===Required Arguments===  
===Optional Arguments===
*'''objects:''' ...
*'''objects:''' Sets if you want the camera to clip on objects.
*'''vehicles:''' ...
*'''vehicles:''' Sets if you want the camera to clip on vehicles.


===Returns===
===Returns===
Returns ''true'' if the arguments are valid, ''false'' otherwise.
Always returns ''true''.


==Example==  
==Example==  
<section name="Client" class="client" show="true">
This function enables it to look through cars
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
-- TODO
function enableCameraThoughCars ()
  setCameraClip (true,false)
  outputChatBox ("Your camera can see the vehicle interior now!",255,0,0,false)
end
addEventHandler ("onClientResourceStart",resourceRoot,enableCameraThoughCars)
</syntaxhighlight>
</syntaxhighlight>
</section>


==See Also==
==See Also==
{{Client camera functions}}
{{Client camera functions}}
[[Category:Needs_Example]]
 
[[Category:Incomplete]]
[[hu:setCameraClip]]

Revision as of 03:45, 11 August 2019

This function sets if the camera will "collide" with any objects or vehicles in its way. This means that if object clip is enabled an object is in the way of where the camera actually wants to be, the camera will try to be in front of it. This function can disable that.

[[{{{image}}}|link=|]] Note: This function doesn't fix the issue of camera clip not working on objects out of world bounds.

Syntax

bool setCameraClip ( [ bool objects = true, bool vehicles = true ] ) 

OOP Syntax Help! I don't understand this!

Method: Camera.setClip(...)
Counterpart: getCameraClip


Optional Arguments

  • objects: Sets if you want the camera to clip on objects.
  • vehicles: Sets if you want the camera to clip on vehicles.

Returns

Always returns true.

Example

This function enables it to look through cars

function enableCameraThoughCars ()
  setCameraClip (true,false)
  outputChatBox ("Your camera can see the vehicle interior now!",255,0,0,false)
end
addEventHandler ("onClientResourceStart",resourceRoot,enableCameraThoughCars)

See Also