本文整理匯總了Python中panda3d.core.PointLight.setShadowCaster方法的典型用法代碼示例。如果您正苦於以下問題:Python PointLight.setShadowCaster方法的具體用法?Python PointLight.setShadowCaster怎麽用?Python PointLight.setShadowCaster使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類panda3d.core.PointLight
的用法示例。
在下文中一共展示了PointLight.setShadowCaster方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: buildSubType
# 需要導入模塊: from panda3d.core import PointLight [as 別名]
# 或者: from panda3d.core.PointLight import setShadowCaster [as 別名]
def buildSubType(self):
"""Build the light with the given subType"""
if self.subType == "pointType":
# make a point light
c = self.color
pointLight = PointLight(self.name)
pointLight.setColor(VBase4(c[0], c[1], c[2], c[3]))
pointLight.setShadowCaster(True, 512, 512)
plnp = self.renderObjectsLight.attachNewNode(pointLight)
plnp.setPos(self.position)
self.lightNP = plnp
self.setLightSwitch(True)
if self.subType == "directType":
# make a directional light
c = self.color
directLight = DirectionalLight(self.name)
directLight.setColor(VBase4(c[0], c[1], c[2], c[3]))
directLight.setShadowCaster(True, 512, 512)
dlnp = self.renderObjectsLight.attachNewNode(directLight)
#dlnp.setHpr(0, -60, 0) # no idea why its like that.. but it works
self.lightNP = dlnp
self.setLightSwitch(True)
if self.subType == "ambientType":
# make a ambient light
c = self.color
ambientLight = AmbientLight(self.name)
ambientLight.setColor(VBase4(c[0], c[1],c[2], c[3]))
alnp = self.renderObjectsLight.attachNewNode(ambientLight)
self.lightNP = alnp
self.setLightSwitch(True)
if self.subType == "spotType":
# make a spot light
# lookAtObj = _object.getTag("lookAt") get rid of this.
c = self.color
spotLight = Spotlight(self.name)
spotLight.setColor(VBase4(c[0], c[1], c[2], c[3]))
spotLight.setShadowCaster(True, 512, 512)
lens = PerspectiveLens()
spotLight.setLens(lens)
slnp = self.renderObjectsLight.attachNewNode(spotLight)
slnp.setPos(self.position)
slnp.setHpr(self.hpr)
# Find out if this is really the only option
# because setHpr doesnt seem to have any effect.
# lookAt would be okay but that means adding anothe type
#slnp.lookAt(self.main.GameObjects["player"].collisionBody)
self.lightNP = slnp
self.setLightSwitch(True)
示例2: __create_point_light
# 需要導入模塊: from panda3d.core import PointLight [as 別名]
# 或者: from panda3d.core.PointLight import setShadowCaster [as 別名]
def __create_point_light(self,
lightId,
lightColor,
lightPos,
shadow = True):
pointLight = PointLight(lightId)
pointLight.setColor(lightColor)
pointLight.setShadowCaster(shadow)
pointLightNP = NodePath(pointLight)
pointLightNP.setPos(lightPos)
return pointLightNP