LineShape2D

Inherits: Shape2D < Resource < Reference < Object

Category: Core

Brief Description

Line shape for 2D collision objects.

Member Functions

float get_d ( ) const
Vector2 get_normal ( ) const
void set_d ( float d )
void set_normal ( Vector2 normal )

Description

Line shape for 2D collision objects. It works like a 2D plane and will not allow any body to go to the negative side. Not recommended for rigid bodies, and usually not recommended for static bodies either because it forces checks against it on every frame.

Member Function Description

float get_d ( ) const

Return the line distance from the origin.

Vector2 get_normal ( ) const

Return the line normal.

void set_d ( float d )

Set the line distance from the origin.

void set_normal ( Vector2 normal )

Set the line normal.

© 2014–2020 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
https://docs.godotengine.org/en/2.1/classes/class_lineshape2d.html