toPVector

fun Vector2.toPVector(): PVector(source)

Converts an instance of Vector2 to a PVector by transforming its x and y values into floating-point numbers.

Receiver

The Vector2 instance to be converted.

Return

A new PVector containing the x and y components of the receiver as floats.


fun Vector3.toPVector(): PVector(source)

Converts a Vector3 instance to a PVector instance.

Each component of the Vector3 (x, y, z) is cast to a float and used to construct a new PVector.

Receiver

The Vector3 to be converted.

Return

A PVector with the corresponding float components.