Transforms a 3D world position to viewport space coordinates in centimeters. Returns a vector3 where Left is the horizontal viewport coordinate (positive is rightward from the screen's top-left corner) and Up is the vertical viewport coordinate (positive is upward, so a point below the top of the screen has a negative Up). Forward is always 0 because viewport coordinates are 2D. Fails if the world position is behind the camera.
Verse using statement |
using { /Verse.org/Input } |
(Player:player).ProjectWorldToViewport<public><native>(WorldPosition:vector3)<computes><decides><reads><dictates>:vector3
Parameters
ProjectWorldToViewport takes the following parameters:
| Name | Type | Description |
|---|---|---|
Player |
player |
|
WorldPosition |
vector3 |
Attributes, Specifiers, and Effects
The following attributes, specifiers, and effects determine how you can interact with ProjectWorldToViewport in your programs, as well as how it behaves in your programs and UEFN. For the complete list of attributes, specifiers, and effects; see the Specifiers Page.
Specifiers
| Specifier | Meaning |
|---|---|
public |
The identifier is universally accessible. You can use this on modules, classes, interfaces, structs, enums, methods, and data. |
native |
Indicates that the definition details of the element are implemented in C++. Verse definitions with the native specifier auto-generate C++ definitions that a developer can then fill out its implementation. You can use this specifier on classes, interfaces, enums, methods, and data. |
Effects
| Effect | Meaning |
|---|---|
computes |
This effect requires that the function has no side effects, and is not guaranteed to complete. There’s an unchecked requirement that the function, when provided with the same arguments, produces the same result. Any function that doesn’t have the native specifier that would otherwise have the converges effect is a good example of using the computes effect. |
decides |
Indicates that the function can fail, and that calling this function is a failable expression. Function definitions with the decides effect must also have the transacts effect, which means the actions performed by this function can be rolled back (as if the actions were never performed), if there’s a failure anywhere in the function. |
reads |
This effect indicates that the same inputs to the function may not always produce the same output. The behavior depends on factors external to the specified inputs, such as memory or the containing package version. |
dictates |