📄 soccerplayer.rsg
字号:
; -*- mode: lisp; -*-(RubySceneGraph 0 1)( ; create the torso (node AgentAspect (setName torso) (setLocalPos 0 0 0.5) (importScene rsg/boxspheres/box.rsg 1.3 1 1 5 matRed) ; install a perceptor to receive the current simulation time (node TimePerceptor) ; install a node holding agent state data (node AgentState (setName AgentState) ) ; install a perceptor to receive info about ball and player positions (node VisionPerceptor (setSenseMyPos false) (setStaticSenseAxis false) (addNoise false) ) ; install a kick effector (node KickEffector (setKickMargin 2) (setForceFactor 0.7) (setTorqueFactor 0.1) (setNoiseParams 0.4 0.02 0.9 4.5) (setSteps 10) (setMaxPower 100.0) (setAngleRange 0.0 50.0) ) ; install a beam effector (node BeamEffector) (node Transform (setLocalPos 0 0.5 0.6) (node Box (setMaterial matBlue) (setExtents 1 0.1 0.2) ) ) (node Transform (setLocalPos 0 0.1 0.6) (node Box (setMaterial matBlue) (setExtents 0.1 0.8 0.2) ) ) ) ; install the left tire (node Transform (setName leftTire) (setLocalPos -0.6 0.5 0.5) (importScene rsg/boxspheres/sphere.rsg 0.51 2 matWhite) (node Transform (setLocalRotation 0 0 180) ; install the joint (node Hinge2Joint (attach ../../sphereBody ../../../torso/boxBody) (setAnchor 0 0 0) ; enable the joint motor (setMaxMotorForce 1 4000) ; install a perceptor to measure the tire movement (node Hinge2Perceptor (setName ltp) ) ; install an effector to control the joint motor (node Hinge2Effector (setName lte) ) ) ; add some boxes to visualize the tire spin (node Box (setExtents 1.1 0.1 0.1) (setMaterial matBlue) ) (node Box (setExtents 0.1 1.1 0.1) (setMaterial matRed) ) (node Box (setExtents 0.1 0.1 1.1) (setMaterial matYellow) ) ) ) ; install the right tire (node Transform (setName rightTire) (setLocalPos 0.6 0.5 0.5) (importScene rsg/boxspheres/sphere.rsg 0.51 2 matWhite) (node Transform (setLocalRotation 0 0 180) ; install the joint (node Hinge2Joint (attach ../../sphereBody ../../../torso/boxBody) (setAnchor 0 0 0) ; enable the joint motor (setMaxMotorForce 1 4000) ; install a perceptor to measure the tire movement (node Hinge2Perceptor (setName rtp) ) ; install an effector to control the joint motor (node Hinge2Effector (setName rte) ) ) ; add some boxes to visualize the tire spin (node Box (setExtents 1.1 0.1 0.1) (setMaterial matBlue) ) (node Box (setExtents 0.1 1.1 0.1) (setMaterial matRed) ) (node Box (setExtents 0.1 0.1 1.1) (setMaterial matYellow) ) ) ) ; install passive back tire (node Transform (setName backTire) (setLocalPos 0 -0.55 0.5) (importScene rsg/boxspheres/sphere.rsg 0.51 2 matGrey) ; install the joint (node Hinge2Joint (attach ../sphereBody ../../torso/boxBody) (setAnchor 0 0 0) ) ) )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -