aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/share/sql/sqlite3-prims.sql
blob: 7cb0a0221d0218e9b0dffcd8661b88eadf2f7c19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
--
-- Database schema for local prim storage
--
-- 
-- Some type mappings
-- LLUID => char(36) (in ascii hex format)
-- uint => integer
-- string => varchar(256) until such time as we know we need bigger

create table prims (
        id integer primary key autoincrement, -- this.LocalID
        ParentID integer default 0, -- this.ParentID
        UUID char(36), -- this.UUID
        CreationDate integer, -- this.CreationDate
        Name varchar(256),
        -- various text fields
        Text varchar(256),
        Description varchar(256),
        SitName varchar(256),
        TouchName 
        -- permissions
        CreatorID char(36),
        OwnerID char(36),
        GroupID char(36),
        LastOwnerID char(36),
        OwnerMask integer,
        NextOwnerMask integer,
        GroupMask integer,
        EveryoneMask integer,
        BaseMask integer,
        -- vectors (converted from LLVector3)
        PositionX float,
        PositionY float,
        PositionZ float,
        VelocityX float,
        VelocityY float,
        VelocityZ float,
        AngularVelocityX float,
        AngularVelocityY float,
        AngularVelocityZ float,
        AccelerationX float,
        AccelerationY float,
        AccelerationZ float,
        -- quaternions (converted from LLQuaternion)
        RotationX float,
        RotationY float,
        RotationZ float,
        RotationW float
);

create index prims_parent on prims(ParentID);
create index prims_ownerid on prims(OwnerID);
create index prims_lastownerid on prims(LastOwnerID);

create table primshapes (
        id integer primary key autoincrement,
        prim_id integer not null,
        -- Shape is an enum 
        Shape integer, 
        -- vectors (converted from LLVector3)
        ScaleX float,
        ScaleY float,
        ScaleZ float,
        -- paths
        PCode integer,
        PathBegin integer,
        PathEnd integer,
        PathScaleX integer,
        PathScaleY integer,
        PathShearX integer,
        PathShearY integer,
        PathSkew integer,
        PathCurve integer,
        PathRadiusOffset integer,
        PathRevolutions integer,
        PathTaperX integer,
        PathTaperY integer,
        PathTwist integer,
        PathTwistBegin integer,
        -- profile
        ProfileBegin integer,
        ProfileEnd integer,
        ProfileCurve integer,
        ProfileHollow integer,
        -- text
        Texture blob
);

create index primshapes_parentid on primshapes(prim_id);