C# 클래스 OpenMetaverse.Helpers

Static helper functions and global variables
파일 보기 프로젝트 열기: 3di/3di-viewer-rei-libs 1 사용 예제들

공개 메소드들

메소드 설명
FloatToTerseString ( float val ) : string

Converts a floating point number to a terse string format used for transmitting numbers in wearable asset files

GetResourceStream ( string resourceName ) : System.IO.Stream

Attempts to load a file embedded in the assembly

GetResourceStream ( string resourceName, string searchPath ) : System.IO.Stream

Attempts to load a file either embedded in the assembly or found in a given search path

GlobalPosToRegionHandle ( float globalX, float globalY, float &localX, float &localY ) : ulong

Given an X/Y location in absolute (grid-relative) terms, a region handle is returned along with the local X/Y location in that region

InventoryCRC ( int creationDate, byte saleType, sbyte invType, sbyte type, UUID assetID, UUID groupID, int salePrice, UUID ownerID, UUID creatorID, UUID itemID, UUID folderID, uint everyoneMask, uint flags, uint nextOwnerMask, uint groupMask, uint ownerMask ) : uint

Calculates the CRC (cyclic redundancy check) needed to upload inventory.

OSDToPrimList ( StructuredData osd ) : List

Deserializes OSD in to a list of primitives

PrimListToOSD ( List prims ) : StructuredData.OSD

Converts a list of primitives to an object that can be serialized with the LLSD system

SplitBlocks ( OpenMetaverse.Packets.PacketBlock blocks, int packetOverhead ) : List
StateToAttachmentPoint ( uint state ) : AttachmentPoint
TEGlowByte ( float glow ) : byte
TEGlowFloat ( byte bytes, int pos ) : float
TEOffsetFloat ( byte bytes, int pos ) : float

TEOffsetShort ( float offset ) : short

TERotationFloat ( byte bytes, int pos ) : float

TERotationShort ( float rotation ) : short

ZeroDecode ( byte src, int srclen, byte dest ) : int

Decode a zerocoded byte array, used to decompress packets marked with the zerocoded flag

Any time a zero is encountered, the next byte is a count of how many zeroes to expand. One zero is encoded with 0x00 0x01, two zeroes is 0x00 0x02, three zeroes is 0x00 0x03, etc. The first four bytes are copied directly to the output buffer.

ZeroEncode ( byte src, int srclen, byte dest ) : int

Encode a byte array with zerocoding. Used to compress packets marked with the zerocoded flag. Any zeroes in the array are compressed down to a single zero byte followed by a count of how many zeroes to expand out. A single zero becomes 0x00 0x01, two zeroes becomes 0x00 0x02, three zeroes becomes 0x00 0x03, etc. The first four bytes are copied directly to the output buffer.

비공개 메소드들

메소드 설명
FieldToString ( StringBuilder output, byte bytes, string fieldName ) : void

Convert a variable length field (byte array) to a string, with a field name prepended to each line of the output

If the byte array has unprintable characters in it, a hex dump will be written instead

메소드 상세

FloatToTerseString() 공개 정적인 메소드

Converts a floating point number to a terse string format used for transmitting numbers in wearable asset files
public static FloatToTerseString ( float val ) : string
val float Floating point number to convert to a string
리턴 string

GetResourceStream() 공개 정적인 메소드

Attempts to load a file embedded in the assembly
public static GetResourceStream ( string resourceName ) : System.IO.Stream
resourceName string The filename of the resource to load
리턴 System.IO.Stream

GetResourceStream() 공개 정적인 메소드

Attempts to load a file either embedded in the assembly or found in a given search path
public static GetResourceStream ( string resourceName, string searchPath ) : System.IO.Stream
resourceName string The filename of the resource to load
searchPath string An optional path that will be searched if /// the asset is not found embedded in the assembly
리턴 System.IO.Stream

GlobalPosToRegionHandle() 공개 정적인 메소드

Given an X/Y location in absolute (grid-relative) terms, a region handle is returned along with the local X/Y location in that region
public static GlobalPosToRegionHandle ( float globalX, float globalY, float &localX, float &localY ) : ulong
globalX float The absolute X location, a number such as /// 255360.35
globalY float The absolute Y location, a number such as /// 255360.35
localX float The sim-local X position of the global X /// position, a value from 0.0 to 256.0
localY float The sim-local Y position of the global Y /// position, a value from 0.0 to 256.0
리턴 ulong

InventoryCRC() 공개 정적인 메소드

Calculates the CRC (cyclic redundancy check) needed to upload inventory.
public static InventoryCRC ( int creationDate, byte saleType, sbyte invType, sbyte type, UUID assetID, UUID groupID, int salePrice, UUID ownerID, UUID creatorID, UUID itemID, UUID folderID, uint everyoneMask, uint flags, uint nextOwnerMask, uint groupMask, uint ownerMask ) : uint
creationDate int Creation date
saleType byte Sale type
invType sbyte Inventory type
type sbyte Type
assetID UUID Asset ID
groupID UUID Group ID
salePrice int Sale price
ownerID UUID Owner ID
creatorID UUID Creator ID
itemID UUID Item ID
folderID UUID Folder ID
everyoneMask uint Everyone mask (permissions)
flags uint Flags
nextOwnerMask uint Next owner mask (permissions)
groupMask uint Group mask (permissions)
ownerMask uint Owner mask (permisions)
리턴 uint

OSDToPrimList() 공개 정적인 메소드

Deserializes OSD in to a list of primitives
public static OSDToPrimList ( StructuredData osd ) : List
osd StructuredData Structure holding the serialized primitive list, /// must be of the SDMap type
리턴 List

PrimListToOSD() 공개 정적인 메소드

Converts a list of primitives to an object that can be serialized with the LLSD system
public static PrimListToOSD ( List prims ) : StructuredData.OSD
prims List Primitives to convert to a serializable object
리턴 StructuredData.OSD

SplitBlocks() 공개 정적인 메소드

public static SplitBlocks ( OpenMetaverse.Packets.PacketBlock blocks, int packetOverhead ) : List
blocks OpenMetaverse.Packets.PacketBlock
packetOverhead int
리턴 List

StateToAttachmentPoint() 공개 정적인 메소드

public static StateToAttachmentPoint ( uint state ) : AttachmentPoint
state uint
리턴 AttachmentPoint

TEGlowByte() 공개 정적인 메소드

public static TEGlowByte ( float glow ) : byte
glow float
리턴 byte

TEGlowFloat() 공개 정적인 메소드

public static TEGlowFloat ( byte bytes, int pos ) : float
bytes byte
pos int
리턴 float

TEOffsetFloat() 공개 정적인 메소드

public static TEOffsetFloat ( byte bytes, int pos ) : float
bytes byte
pos int
리턴 float

TEOffsetShort() 공개 정적인 메소드

public static TEOffsetShort ( float offset ) : short
offset float
리턴 short

TERotationFloat() 공개 정적인 메소드

public static TERotationFloat ( byte bytes, int pos ) : float
bytes byte
pos int
리턴 float

TERotationShort() 공개 정적인 메소드

public static TERotationShort ( float rotation ) : short
rotation float
리턴 short

ZeroDecode() 공개 정적인 메소드

Decode a zerocoded byte array, used to decompress packets marked with the zerocoded flag
Any time a zero is encountered, the next byte is a count of how many zeroes to expand. One zero is encoded with 0x00 0x01, two zeroes is 0x00 0x02, three zeroes is 0x00 0x03, etc. The first four bytes are copied directly to the output buffer.
public static ZeroDecode ( byte src, int srclen, byte dest ) : int
src byte The byte array to decode
srclen int The length of the byte array to decode. This /// would be the length of the packet up to (but not including) any /// appended ACKs
dest byte The output byte array to decode to
리턴 int

ZeroEncode() 공개 정적인 메소드

Encode a byte array with zerocoding. Used to compress packets marked with the zerocoded flag. Any zeroes in the array are compressed down to a single zero byte followed by a count of how many zeroes to expand out. A single zero becomes 0x00 0x01, two zeroes becomes 0x00 0x02, three zeroes becomes 0x00 0x03, etc. The first four bytes are copied directly to the output buffer.
public static ZeroEncode ( byte src, int srclen, byte dest ) : int
src byte The byte array to encode
srclen int The length of the byte array to encode
dest byte The output byte array to encode to
리턴 int