Navigation:  thinBasic Modules > TBASS (Sound Module) > TBASS 3D and EAX >

TBASS_Set3DPosition

Previous pageReturn to chapter overviewNext page

 

Description

 

Sets the position, velocity, and orientation of the listener (ie. the player).

 

Syntax

 

n = TBASS_Set3DPosition(Pos, Vel, Front, Top)

 

Returns

 

Number

If successful, then %TBASS_TRUE is returned, else %TBASS_FALSE is returned. Use TBASS_ErrorGetCode to get the error code.

 

Parameters

 

Name

Type

Optional

Meaning

Pos

ptrStruct

No

The position of the listener

NULL = leave current.

Vel

ptrStruct

No

The listener's velocity in units (as set with TBASS_Set3DFactors) per second

NULL = leave current.

This is only used to calculate the doppler effects, and in no way affects the listener's position.

Front

ptrStruct

No

The direction that the listener's front is pointing

NULL = leave current.

This is automatically normalized.

Top

ptrStruct

No

The direction that the listener's top is pointing

NULL = leave current.

This is automatically normalized, and adjusted to be at a right-angle to the front vector if necessary.

 

Remarks

 

Attention: all parameters in this function are pointer to a UDT with the following structure:

 

Type TBASS_3DVECTOR

 As Single

 As Single

 As Single

End Type

 

Use VARPTR to pass a pointer to a variable structure with the above structure.

 

The front and top parameters must both be set in a single call, they can not be set individually.

As with all 3D functions, use TBASS_Apply3D to apply the changes.

 

Restrictions

 

See also

 

Examples