aoTools

package module
v0.0.0-...-6cf1983 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: MIT Imports: 3 Imported by: 0

README

mt-multiserver-activeobject (aoTools)

this library contains some useful functions for working with active objects in mt-mulitserver-proxy

Documentation: https://pkg.go.dev/github.com/ev2-1/mt-multiserver-activeobject/

It also contains some vector functionality.

Also rotation things

Documentation

Overview

this file contains some functions for creating active objects

this file contains rotation code

this file contains a bunch of probably redundent vector operations

Index

Constants

View Source
const (
	X = 0
	Y = 1
	Z = 2
)

XYZ for vec type

Variables

This section is empty.

Functions

func AOPos

func AOPos(id mt.AOID, pos mt.AOPos) mt.IDAOMsg

AOPos creates a IDAOMsg setting the pos of ao`id` to `pos`

func AddAO

func AddAO(id mt.AOID, p mt.Pos, props mt.AOProps) mt.AOAdd

AddAO creates a AOAdd with specified AOID, POS and AOProps

func CubeAO

func CubeAO(mediaPool, name string) mt.AOProps

CubeAO creates a AOProps object for a cube name can be anything that has a "tnt"-like texture naming scheme mediaPool is the mediapool the textures are contained in

func Example

func Example() (add []mt.IDAOMsg)

Example is a *example* function on how to use this library The AOIDs have to added manualy preveausly if you read this commend on pkg.go.dev just click the blue part to see the code

func VecLen2d

func VecLen2d(v Vec) float64

Types

type Vec

type Vec [3]float64

Vec is a 3 dimensional float64 vector

func Pos2vec

func Pos2vec(p mt.Pos) (v Vec)

Pos2vec

func RotateAroundAxis2a

func RotateAroundAxis2a(point, axis Vec, angle float64) Vec

RotateAroundAxis2a rotates around `point` singe `axis` on XZ plane, Y axis is ignored `angle` specifie angle to XY plane (or YZ idk)

func RotateAroundAxis3a

func RotateAroundAxis3a(point, axis, angles Vec) Vec

RotateAroundAxis3a gets Position rotated `point` around `axis` based on angles angles is 0:XY; 1:XZ; 2:YZ

func ShiftAngle

func ShiftAngle(pos, relPos Vec, angle float64) Vec

ShiftAngle shifts `relPos` relative to `pos` `angle` specifie angle to XY plane (or YZ idk)

func VecAdd

func VecAdd(a, b Vec) (v Vec)

func VecSub

func VecSub(a, b Vec) (v Vec)

func (Vec) Pos

func (v Vec) Pos() (p mt.Pos)

Jump to

Keyboard shortcuts

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