home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Inventor Labs: Technology
/
INVENTORLABS_TECHNOLOGY.BIN
/
mac
/
FILES
/
SHARED.CST
/
00036_Script_MacQTVRParent
< prev
next >
Wrap
Text File
|
1997-07-24
|
8KB
|
255 lines
--p MacQTVR
property pFileNameTxt
property pHpanStr, pVpanStr, pZoomStr, pQualityStr
property pPanoIDint
property pPanoRectStr
property pPanoSpriteInt
property pQTVRpath
property pPanoFilenameStr
property pHSactionObj, pActive, pCursorState
property pQTVRxtraIns
--/
global gActorListMgrObj, gInterfaceMgrObj
global gEventMgrObj
--/ Developement
global gActiveQTVRhandler, gQTVRCallBackFactory, gGalleryMgr
global gQTVRobj, gInventorIndexNum, gQTVRpath, gAvailbleInv
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
on mInit me, QTVRspriteNumInt, QTpath
-- repeated calls to RegisterComponent will result in memory loss
if the machinetype = 256 then
if the platform = "Windows,32" then openxlib ( the pathname & "QTVRW32.X32")
else openxlib ( the pathname & "Qtvrw.x16")
else openxlib ( the pathname & "QTVRXtra")
QTVREnter(xtra "QTVRXtra")
set pPanoIDint = new(xtra "QTVRXtra")
set pPanoSpriteInt = QTVRspriteNumInt
set SpriteRect = string(the rect of sprite pPanoSpriteInt)
set pPanoRectStr = chars( SpriteRect,6, length(SpriteRect) -1)
set pQTVRpath = gQTVRpath
set pQualityStr = "4.0"
set pCursorState = #QTVR
mCreateCallBack (me)
set pActive = FALSE
set gQTVRobj = me
return( me )
end mInit
-------------------------------------------------------------------------------------------------------
on mSwingToView me, SwingToViewStr, SpeedStr
mSetQTVRView( me, SwingToViewStr )
QTVRSetTransitionMode(pPanoIDint, "swing")
QTVRSetTransitionSpeed(pPanoIDint, SpeedStr)
QTVRUpdate(pPanoIDint)
-- Set transition mode to normal
QTVRSetTransitionMode(pPanoIDint, "normal")
end mSwingToView
-------------------------------------------------------------------------------------------------------
on mSetQTVRView me, NewViewStr
mSetQTVRProps( me, NewViewStr )
QTVRSetFOV(pPanoIDint,pZoomStr)
QTVRSetTiltAngle(pPanoIDint,pVpanStr)
QTVRSetPanAngle(pPanoIDint,pHpanStr)
QTVRSetQuality(pPanoIDint, pQualityStr)
end mSetQTVRView
-------------------------------------------------------------------------------------------------------
on mSetQTVRProps me, NewViewStr
set pHpanStr = item 1 of NewViewStr
set pVpanStr = item 2 of NewViewStr
set pZoomStr = item 3 of NewViewStr
end mSetQTVRProps
-------------------------------------------------------------------------------------------------------
on mGetQTVRProps me
set pHpanStr = QTVRGetPanAngle(pPanoIDint)
set pVpanStr = QTVRGetTiltAngle(pPanoIDint)
set pZoomStr = QTVRGetFOV(pPanoIDint)
set pQualityStr = QTVRGetQuality(pPanoIDint)
return( pHpanStr & "," & pVpanStr & "," & pZoomStr & "," & pQualityStr)
end mGetQTVRProps
-------------------------------------------------------------------------------------------------------
on mOpen me, PanoFilenameStr, IntialViewStr, QTVRspriteNumInt
QTVRClose( pPanoIDint )
-- set pPanoIDint = new(xtra "QTVRXtra")
-- mCreateCallBack (me)
set pPanoSpriteInt = QTVRspriteNumInt
set SpriteRect = string(the rect of sprite pPanoSpriteInt)
set pPanoRectStr = chars( SpriteRect,6, length(SpriteRect) -1)
set pPanoFilenameStr = PanoFilenameStr
set pFileNameTxt = pQTVRpath & pPanoFilenameStr
put "pFileNameTxt " & pFileNameTxt
QTVROpen(pPanoIDint, pFileNameTxt, pPanoRectStr, "invisible")
mSetQTVRView( me, IntialViewStr)
set gActiveQTVRhandler = pPanoIDint
mInitPanoCallbacks (me, pPanoIDint)
set pActive = TRUE
mShow ( me )
mAddToActorlist (gActorListMgrObj, me)
end mOpen
-------------------------------------------------------------------------------------------------------
on mUpdate me
QTVRUpdate(pPanoIDint)
end mUpdate
-------------------------------------------------------------------------------------------------------
on mShow me
QTVRSetVisible(pPanoIDint, true)
QTVRUpdate(pPanoIDint)
Cursor 200
Cursor 0
set pCursorState = #QTVR
set pActive = TRUE
end mShow
-------------------------------------------------------------------------------------------------------
on mHide me
mSetCursors(gUtilityObj)
set pActive = FALSE
QTVRSetVisible(pPanoIDint, false)
Cursor 200
Cursor -1
end mHide
-------------------------------------------------------------------------------------------------------
on mClose me
set pActive = FALSE
if objectp( pPanoIDint) then QTVRClose(pPanoIDint)
--set pPanoIDint = 0
mDeleteFromActorlist (gActorListMgrObj, me)
--/
set gActiveQTVRhandler = empty
--/
end mClosePanoMovie
-------------------------------------------------------------------------------------------------------
on mPerform me
if pActive then
if rollover( pPanoSpriteInt) then
idle
mClearBtnHilites( gInterfaceMgrObj )
-- updatestage
set pCursorState = #QTVR
if the mousedown then exit
set MouseOverResult = QTVRMouseOver(pPanoIDint)
if (gInventorIndexNum = 4) then
set Horz = QTVRGetPanAngle(pPanoIDint)
mCheckAudioCue ( gGalleryMgr, value( Horz ))
end if
set whataction = item 1 of string(MouseOverResult)
if (gInventorIndexNum = 4) and (whataction = "undf" ) then
set MouseClickIndex = value( item 2 of MouseOverResult)
case gAvailbleInv of
#Bell: if (MouseClickIndex = 5) or (MouseClickIndex = 3) then set whataction = "None"
#Watt: if (MouseClickIndex = 1) or (MouseClickIndex = 3) then set whataction = "None"
#Edison: if (MouseClickIndex = 5) or (MouseClickIndex = 1) then set whataction = "None"
end case
end if
if (whataction = "undf" ) then mVRHSaction (gInterfaceMgrObj, value( item 2 of MouseOverResult))
else
if pCursorState = #QTVR then mResetCursor (me)
QTVRIdle(pPanoIDint)
end if
end if
end mPerform
-------------------------------------------------------------------------------------------------------
on mResetCursor me
cursor 200
cursor -1
set pCursorState = #INTERFACE
end
-------------------------------------------------------------------------------------------------------
on mCreateCallBack me
--- instantiate callback object; receives callbacks from QTVR; QTVR callbacks only work with factories
if the machinetype <> 256 then
set gQTVRCallBackFactory = CallBackTracer(mNew)
SetCallBack PanoMovie, gQTVRCallBackFactory
end if
end
----------------------------------------
on mInitPanoCallbacks me
if objectp(pPanoIDint) then
set callbackhandler = "mVRHS"
QTVRSetRolloverHotSpotHandler(pPanoIDint,callbackhandler)
--QTVRSetMouseOverHandler(pPanoIDint,"sampleMouseOverHandler")
--QTVRSetMouseDownHandler(pPanoIDint,"sampleMouseDownHandler")
--QTVRSetPanZoomStartHandler(pPanoIDint,"samplePanZoomStartHandler")
--QTVRSetMouseStillDownHandler(pPanoIDint,"sampleMouseStillDownHandler")
--QTVRSetNodeLeaveHandler(pPanoIDint,"sampleNodeLeaveHandler")
--QTVRSetRolloverHotSpotHandler(pPanoIDint,empty)
QTVRSetMouseOverHandler(pPanoIDint,empty)
QTVRSetMouseDownHandler(pPanoIDint,empty)
QTVRSetPanZoomStartHandler(pPanoIDint,empty)
QTVRSetMouseStillDownHandler(pPanoIDint,empty)
QTVRSetNodeLeaveHandler(pPanoIDint,empty)
end if
end mInitPanoCallbacks
-------------------------------------------------------------------------------------------------
on mVRHS me, HotSpotID --- displays text for QTVR hotspot; from QTVR callback
--put "HotSpotID " & HotSpotID
mDisplayText( gInterfaceMgrObj, value( HotSpotID ) )
end
-------------------------------------------------------------------------------------------------