oscvrc

package module
v0.0.0-...-84653f2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2025 License: MIT Imports: 9 Imported by: 0

README

Documentation

Index

Constants

View Source
const (
	DefaultAddr = "127.0.0.1"
	DefaultPort = 9000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AvatarParamConfig

type AvatarParamConfig struct {
	ID         string            `json:"id"`
	Name       string            `json:"name"`
	Parameters []ParameterConfig `json:"parameters"`
}

type AxesLookDirection

type AxesLookDirection string
const (
	AxisLookLeft  AxesLookDirection = "LookHorizontal"
	AxisLookRight AxesLookDirection = "LookVertical"
)

type AxesMoveDirection

type AxesMoveDirection string
const (
	AxisVertical   AxesMoveDirection = "Vertical"
	AxisHorizontal AxesMoveDirection = "Horizontal"
)

type Client

type Client struct {
	*osc.Client
}

func NewOscClient

func NewOscClient(addr string, port int) Client

Initiates an OSC client Default address is localhost (127.0.0.1), Default port is 9000

func (*Client) Chat

func (c *Client) Chat(s string, b, n bool) error

Chat is a function that sends a message into the VRChat text chat. If b is True, send the text in s immediately, bypassing the keyboard. If b is False, open the keyboard and populate it with the provided text. n is an additional bool parameter that when set to False will not trigger the notification SFX (defaults to True if not specified).

func (*Client) ComfortLook

func (c *Client) ComfortLook(direction ComfortLookDirection, b bool) error

ComfortLook works the same as Look, but for comfort turning using snap turns. VR Only.

func (*Client) DropHand

func (c *Client) DropHand(hand DropHand, b bool) error

DropHand drops the item in the hand of the specified side. It takes a DropHand and a boolean value as parameters. The boolean value indicates whether to enable or disable the drop hand action. VR Only.

func (*Client) GrabHand

func (c *Client) GrabHand(hand GrabHand, b bool) error

GrabHand grabs the item in the hand of the specified side. It takes a GrabHand and a boolean value as parameters. The boolean value indicates whether to enable or disable the grab hand action. VR Only.

func (*Client) Jump

func (c *Client) Jump() error

Jump if the world supports it.

func (*Client) Look

func (c *Client) Look(direction LookDirection, b bool) error

Look sends an OSC message to control the look direction. It takes a LookDirection and a boolean value as parameters. The boolean value indicates whether to enable or disable the look direction. It returns an error if there was a problem sending the message.

func (*Client) Move

func (c *Client) Move(direction MoveDirection, b bool) error

Move sends a move direction and a boolean value to the OSC server. It takes a MoveDirection and a boolean value as parameters. The boolean value indicates whether to enable or disable the move direction. It returns an error if there was a problem sending the message.

func (*Client) PanicButton

func (c *Client) PanicButton(b bool) error

Turn off and on Safe Mode.

func (*Client) ReadAvatarParamConfig

func (c *Client) ReadAvatarParamConfig(avatarId, userId string, path string) (AvatarParamConfig, error)

ReadAvatarParamConfig reads the avatar parameter configuration from the specified file. The returned struct should be used in conjunction with the client.SendMessage function to send messages to the VRChat avatar parameters. The `path` can be specified to read from a custom location. If `path` is empty, it will default to the standard VRChat path based on the operating system. It should point to ~/AppData/LocalLow/VRChat/VRChat/OSC/

func (*Client) Run

func (c *Client) Run(b bool) error

Run if the world supports it.

func (*Client) SendMessage

func (c *Client) SendMessage(address string, value ...interface{}) error

SendMessage is a helper function that sends an OSC message to VRChat.

func (*Client) UseHand

func (c *Client) UseHand(hand UseHand, b bool) error

UseHand uses the item in the hand of the specified side. It takes a UseHand and a boolean value as parameters. The boolean value indicates whether to enable or disable the use hand action. VR Only.

func (*Client) Voice

func (c *Client) Voice() error

TODO: Voice, Quick Menu

type ComfortLookDirection

type ComfortLookDirection string
const (
	ComfortLookLeft  ComfortLookDirection = "ComfortLeft"
	ComfortLookRight ComfortLookDirection = "ComfortRight"
)

type DropHand

type DropHand string
const (
	DropLeftHand  DropHand = "DropLeft"
	DropRightHand DropHand = "DropRight"
)

type GrabHand

type GrabHand string
const (
	GrabLeftHand  GrabHand = "GrabLeft"
	GrabRightHand GrabHand = "GrabRight"
)

type InputConfig

type InputConfig struct {
	Address string `json:"address"`
	Type    string `json:"type"`
	// contains filtered or unexported fields
}

func (*InputConfig) Send

func (i *InputConfig) Send(value ...interface{}) error

type LookDirection

type LookDirection string
const (
	LookLeft  LookDirection = "LookLeft"
	LookRight LookDirection = "LookRight"
)

type MoveDirection

type MoveDirection string
const (
	MoveForward  MoveDirection = "MoveForward"
	MoveBackward MoveDirection = "MoveBackward"
	MoveLeft     MoveDirection = "MoveLeft"
	MoveRight    MoveDirection = "MoveRight"
)

type OutputConfig

type OutputConfig struct {
	Address string `json:"address"`
	Type    string `json:"type"`
}

type ParameterConfig

type ParameterConfig struct {
	Name   string       `json:"name"`
	Input  InputConfig  `json:"input,omitempty"`
	Output OutputConfig `json:"output"`
}

type UseHand

type UseHand string
const (
	UseLeftHand  UseHand = "UseLeft"
	UseRightHand UseHand = "UseRight"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL